Tuesday, July 24, 2012

[Solved] DIV background color not showing

If you have a div tag that has background-color set but it doesn't show at all because there is dynamic content in it with some further tags that have content in it and hence you can not set a fixed height e.g.

<div class="bgcolorRed">
      <div>...content....</div>
      <dl>.....content....</dl>
</div>

Just simply add 'overflow: hidden' along with you background color in CSS and it will work
i.e.

.bgcolorRed {
     background-color: red;
     overflow: hidden;
}

Hope that helps.

No comments:

Post a Comment