the CSS entries :
"font-size: 14px;" by "font-size: 16px;"
and
"font-height: 23px;" by "font-height: 18px;"
How exactly can I achieve this with GM?
Ben
you probably need to select specific elements in place of body and add
more than one rule
try discovering which rule defined the font style in the first place
and use that selector.
> --
> You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
> To post to this group, send email to greasemon...@googlegroups.com.
> To unsubscribe from this group, send email to greasemonkey-us...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
>
>
Does GM_addstyle() also OVERWRITE existing rules? or does it only add/
append new rules?
In other words is there a similar GM_modifyStyle() function?
The detailed (final) rule look like:
.articleContent .module .text p {
font-size: 16px;
line-height: 18px;
}
Can I write then:
GM_addStyle("articleContent .module .text p { font-size: 16px; line-
height: 18px; }");
Ben
I notice I typed the important keyword wrong:
GM_addStyle("body{font-size:16px !important;}");
there should be no semicolon
http://webdesign.about.com/od/css/f/blcssfaqimportn.htm
That statement is incorrect. Read about "specificity" in CSS:
http://www.w3.org/TR/CSS2/cascade.html#specificity
(The "!important" keyword is just the highest specificity single
element. Except for being in the style attribute, rather than in a
sheet. Order is the lowest contributing element to specificity.)
> I notice I typed the important keyword wrong ... there should be no
semicolon
That also isn't strictly true. There definitely _should_ be, if there's
another declaration. With only one it's optional, but "should be no" is
going too far in my book.
GM_addStyle("body{font-size: 16px; !important;}");
for whatever reason even though I removed it in my reply, it still
shown on my screen as quoted text.
My incorrect statement, what I meant to say that the same exact
selector appended later will over-ride any rules that were defined by
that selector earlier.
It doesn't append rules so much as it appends selectors (that may
contain rules which may over-ride previous rules defined by that
selector).
Calling the selector and containing statements a rule seems all too
common, but strictly incorrect.
And Thank You for the link about specificity! Very interesting to
have a definitive knowledge other than trial and error. It makes
perfect sense given what I've experienced.
Yes.
> My incorrect statement, what I meant to say that the same exact
> selector appended later will over-ride any rules that were defined by
> that selector earlier.
That is correct.
> And Thank You for the link about specificity! Very interesting to
> have a definitive knowledge other than trial and error. It makes
> perfect sense given what I've experienced.
Yeah, my mind was a little blown the first time I learned that too.
Obvious in hindsight but mysterious until you know that detail.