...

View Full Version : Strange "expand"problem



CaptainB
10-16-2007, 09:46 PM
Hi guys!

I have spent the most of the evening pulling the soon gray hairsout of my head! When I'm viewing this page: http://www.behrentzs.com/wallpapers.php in Firefox, the background color for my h4 tag, which I have used for my catagory headings, is expanded. I don't know why, and according to the W3C validator everything should be all right.

Maybe you can spot the error(?)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Behrentzs - Wallpapers</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<link href="style/menu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="javascript/javascripts.js"></script>
</head>

<body>
<div id="container">
<div id="header"></div>
<div id="menu">
<ul id="menuitems">
<li><a href="index.php">Home</a></li>
<li onmouseover="dropdownmenu(this, event, menu1, '120px')" onmouseout="delayhidemenu()"><a href="portfolio.php">Portfolio</a></li>
<li onmouseover="dropdownmenu(this, event, menu2, '120px')" onmouseout="delayhidemenu()"><a href="multimedia.php">Multimedia</a></li>
<li onmouseover="dropdownmenu(this, event, menu3, '120px')" onmouseout="delayhidemenu()"><a href="design.php">Design</a></li>
<li onmouseover="dropdownmenu(this, event, menu4, '120px')" onmouseout="delayhidemenu()"><a href="forums.php">Forums</a></li>
<li onmouseover="dropdownmenu(this, event, menu5, '120px')" onmouseout="delayhidemenu()"><a href="links.php">Links</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
<div id="main">
<h3>Wallpapers</h3><br/>
<h4>Abstract</h4>
<ul class="linjer">

<li><img src="gfx/thumbnails/wallpapers/abstract/bg1.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_1_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg2.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_2_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg3.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_3_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg4.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_4_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg5.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_5_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg6.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_6_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg7.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_7_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg8.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_8_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg9.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_9_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg10.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_10_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/abstract/bg11.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/abstract/1280_800/abst_11_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>
</ul>

<h4>Landscapes</h4>
<ul class="linjer">
<li><img src="gfx/thumbnails/wallpapers/landscapes/bg1.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/landscapes/1280_800/land_1_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>

<li><img src="gfx/thumbnails/wallpapers/landscapes/bg2.jpg" border="0" alt="" /><br /><a href="downloads/wallpapers/landscapes/1280_800/land_2_1280_800.zip" target="_blank">1280 x 800</a><br/>1024 x 768</li>
</ul>


</div>
<div id="footer">
<div id="footertext">
<a class="footer" href="copyright.php" >Copyright &copy; Behrentzs | All rights reserved</a>
</div>
<div id="footersigns"><img src="gfx/xhtml.png" border="0" alt="Valid XHTML" /><img src="gfx/css.png" border="0" alt="Valid CSS" /></div>

</div>
</div>
</body>
</html>

Fang
10-17-2007, 06:46 AM
Add clear:both; to h4

CaptainB
10-17-2007, 11:41 AM
Thanks a bunch!

May I ask how clear:both affects the objects?

Fang
10-17-2007, 12:05 PM
ul is floated and followed by h4
An element following a floated element will try to wrap around the float unless it is cleared.

CaptainB
10-17-2007, 12:51 PM
Ah, now I got it. That's really good to know! Thanks again!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum