Jump to content

Style In Style, Not Doing What I Want


smerny

Recommended Posts

.fh2{width: 900px;background: #99ffff;border: 1px solid #fff;color: #339933;margin: 0;padding: 0px;clear: both;}.left{float: left;}.right{float: right;}

			<div class='fh2'>			  <div class='left'>				<a href='index.php?page_mode=boardview&board_id=1'>cat1 board1</a> - 			  </div>			  <div class='right'>				Last post by <a href='../members.php?action=getinfo&userid=1'>testuser</a>			  </div>			</div>

I was expecting everything within fh2 to take on the color and background color, but it wont... if i comment out the .left and .right in the CSS sheet it does... so a div with float:left and float:right and NO colors negates the colors in the outer div?

Link to comment
Share on other sites

it are the <a href>-tags that do not inherit the styling of the parent, they never do.Where you have in the css.fh2 { ... }make it.fh2,.fh2 a { ... }That will fix it.

Link to comment
Share on other sites

Remove clear: both; and insert float: left;because this has no float assigned to it, it is ignored and does not contain the other divs, it just shows as an empty div.ORif you require the clear: both within .fh2, then insert <div style="clear:left; height: 0px; font-size:0px; line-height:0px;"> </div> below right div, but within fh2 outer div.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...