Link to home
Start Free TrialLog in
Avatar of mescalin
mescalin

asked on

Empty div height

I have following in my css file:

.div343
{
      -moz-border-radius: 4px;
      -webkit-border-radius: 4px;
      border-radius: 4px;
      background-color: #FFFFFF;
      max-width: 545px;
      padding: 7px;
}


I have a static content and have this div in so many pages. I want to have it invisible with 0px height if <div>   </div> is empty.

Is it possible to solve it directly with css?
Avatar of LZ1
LZ1
Flag of United States of America image

Unfortunately CSS won't work programatically(sp?). Are you using any type of server side language like PHP or .NET?  

Or you could use Javascript as well.  CSS alone won't do it though.
ASKER CERTIFIED SOLUTION
Avatar of Mark Steggles
Mark Steggles
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you need to configure the div with no border, padding or margins,,
and the "div content"  must give some  formatting attributes like padding.


<div></div>

<div><span class='borders'>your content</span></div>