Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts

    Strange "expand"problem

    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(?)
    Code:
    <!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>

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Posts
    495
    Thanks
    0
    Thanked 82 Times in 80 Posts
    Add clear:both; to h4

  • Users who have thanked Fang for this post:

    CaptainB (10-17-2007)

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Thanks a bunch!

    May I ask how clear:both affects the objects?

  • #4
    Regular Coder
    Join Date
    Jun 2004
    Posts
    495
    Thanks
    0
    Thanked 82 Times in 80 Posts
    ul is floated and followed by h4
    An element following a floated element will try to wrap around the float unless it is cleared.

  • Users who have thanked Fang for this post:

    CaptainB (10-17-2007)

  • #5
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Ah, now I got it. That's really good to know! Thanks again!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •