I\'m generating a page for an upcoming portal site, and I\'ve got an HTML element with some optional content. I\'d like the element to not render if it is empty, but adding some
You can do the trick with the CSS3 pseudo-class :empty
.someElement { // your standard style } .someElement:empty { display:none; }
Sadly Internet explorer doesn't support that feauture yet. For all the other browsers it shall do just fine...