Dennis Thrysøe wrote:
> Zoe M. Gillenwater wrote:
>> Do you know what the parent of these divs will be?
> No, unfortunately I don't. My divs must be inserted at arbitrary
> places of arbritrary HTML. But I could add as many divs, as I wish -
> that would seem sort of strange though.
>> It would be great if you could get an id in your selector to make it
>> more specific, like "div#main div.myclass".
> But ids must be unique in a document, right? I need to insert several
Yes, but I'm not saying to add ids to *your* divs. I'm referring to the
parent div of the divs you are inserting. I was asking whether the
parent div (singular) was known and could have an id assigned to it,
from which you could construct a descendant selector using your class.
>> If not, you can still add more to your selector to add a bit more
>> weight to it: "html body div.myclass" is more specific than
>> "div.myclass." This can't guarantee that your styles won't get
>> overridden, but it may help.
> Thanks I'll go that way. I'm beginning to think, that what I'm trying
> to do isn't possible at all.
You can always try adding !important to whatever rules you want to make
sure are applied.
Zoe M. Gillenwater
Highway Safety Research Center
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/