OZONE Asylum
Forums
CSS - DOM - XHTML - XML - XSL - XSLT
How do I set the style of an element based upon what it contains in CSS...
This page's ID:
30435
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
not using CCS2, you'll have to use the [url=http://www.w3.org/TR/css3-selectors/#empty-pseudo]CSS3 :empy pseudo classe[/url] which works in [url=http://www.css3.info/modules/selector-compat/]all browsers worth their title[/url]. Unfortunately there is no ancestor selector in CSS, so you can't target an element based on whether its children matches some rules. But you probably don't need that. Try:[code].container { display:block; } .container:empty { display:none; }[/code]The fact that IE do not support the :empty pseudo class should not be a big deal. Just an empty space the size of the margin/padding of .container, nothing more. HTH [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love_small.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_charly.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_dk.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_reason.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_neon88x31.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_teapot.png[/img][/sigrotate][/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »