On Sun, Jul 7, 2013 at 1:35 PM, Ben Stover <[email protected]> wrote:
> I want to assign soemthing to DIVs with a classnames which contains a blank.
> Example. For
>
> <div class="foo bar">
> ....
> </div>
>
> I want to assign in a GM script:
>
> GM_addStyle("div#foo bar { display: none !important; }");
>
> Obviously this doesn't work.
>
> Same with:
>
> GM_addStyle("div#foo div#bar { display: none !important; }");
>
> So how can I assign the "display: none" style otherwiese?
>
> Ben
>
>

Looks like you didn't receive my previous email  // CCing

On Fri, Jul 5, 2013 at 11:19 PM, I wrote:
>
> For class attribute, use 'period' notation.
>
> p.myp
>
> See http://www.w3.org/TR/css3-selectors/ for reference.
>
>

<element class="foo bar"> means that the element has two classes,
"foo" and "bar".

Use
  GM_addStyle("div.foo.bar { display: none !important; }");

Alternatively, you can use attribute selector
  GM_addStyle("div[class='foo bar'] { display: none !important; }");


--
Zulkarnain K.
http://userscripts.org/users/12
http://loucypher.github.com/

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to