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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Floats mess up layout in Firefox

    Hi all,

    I've been working on this site and the CSS has been going pretty well up to now. The problem I've run into is that my content section (below the tabs) doesn't expand completely in Firefox (it looks correct in IE).

    From what I have read online I need to clear the floats by inserting an empty div with the style="clear:both;" at the end of the div I want cleared.

    I have tried inserting that div everywhere I can think of, but to no avail. If someone can help me figure out what is going on it would be very much appreciated.

    Below is my code for the HTML and CSS:

    ************************************
    HTML <--------------------------------> HTML
    ************************************

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>Page Title</title>
    <link href="screen.css" rel="stylesheet" type="text/css" media="all" />

    </head>

    <body>
    <div id="Container">

    <div id="Title">Title Title Title</div>

    <div id="Tabs">
    <ul>
    <li id="Current"><a href="../index.htm"><span>Home</span></a></li>
    <li><a href="graphics/graphics_mod01.htm"><span>Graphics</span></a></li>
    </ul>
    </div>

    <div id="Content">
    <h1>Title</h1>
    <span class="navButtons"><img src="images/noprev.gif" /><a href="mod02/02_0_01.htm"><img src="images/next.gif" /></a></span>
    <h3>SubTitle</h3>

    <img src="images/welcome.jpg" class="slideImage" />

    <p>Content text. Blah blah blah. Content text. Blah blah blah. Content text. Blah blah blah. Content text. Blah blah blah. </p>

    <p class="footer"><a class="noLink">&lt; Previous Page</a> &nbsp;::&nbsp; <a href="mod02/02_0_01.htm" title="Next Page">Next Page &gt;</a></p>

    </div>

    <div id="Menu">
    <div id="mainMenu">
    <ul id="menuList">

    <li><a href="#">01: Introduction</a></li>
    <li><a href="#">02: Link 2</a></li>
    <li><a href="#">03: Link 3</a></li>
    <li><a href="#">04: Link 4</a></li>
    <li><a href="#">05: Link 5</a></li>
    </ul>
    </div>
    </div>

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


    **********************************
    CSS <--------------------------------> CSS
    **********************************

    body {
    background: url(images/bg.gif) no-repeat;
    background-attachment:fixed;
    margin:0px;
    padding:0px;
    font-family:verdana, arial, helvetica, sans-serif;
    color:#333;}

    #Container {
    position: absolute;
    left: 10px;
    top: 0;
    width: 795px;
    /* right: auto; bottom: auto; margin-left: -370px; *** Include this comment section for centered page - won't work with 640 x 480*/}

    /* ***** Styles * Styles * Styles * Styles * Styles * ***** */

    h1 {text-align: left;
    margin:0px 0px 15px 0px;
    padding:0px;
    font-size:26px;
    line-height:26px;
    font-weight:bold;
    color:#ccc;}

    h3 {text-align: left;
    margin:0px 0px 10px 0px;
    padding:0px;
    font-size:16px;
    line-height:16px;
    font-weight:bold;
    color:#000000;}

    p { font:12px/20px verdana, arial, helvetica, sans-serif;
    margin:0 0 20px 0;
    padding:0px;}

    a { color:#09c;
    text-decoration:none;
    font-weight:bold;
    font-family:verdana, arial, helvetica, sans-serif;}

    a:link, a:visited {color:#09c;}

    a:hover {color:#000000;}

    img {border:1px solid #000000;}

    .noLink {
    color:#999999;
    text-decoration:none;
    font-family:verdana, arial, helvetica, sans-serif;}

    .letter {
    font-weight:bold;
    border:1px solid #CCCCCC;
    padding: 0 390px 0 2px;}

    .slideImage {
    padding: 0 0 10px 10px;
    border:0;
    float:right;}

    .footer {
    position:absolute;
    margin-bottom:5px;
    bottom:0px;
    clear:both;}

    .list li {
    font:12px/20px verdana, arial, helvetica, sans-serif;
    margin:0;
    padding:0px;}

    .navButtons {float:right;}

    .navButtons img {
    border:0;
    padding: 0 0 0 5px;}

    /* ***** Title * Title * Title * Title * Title * ***** */

    #Title {
    background: url(images/PDI_bar.gif) no-repeat;
    padding: 72px 0 0 0;
    overflow: hidden;
    height: 0px !important; /* for most browsers */
    height /**/:72px; /* for IE5.5's bad box model */}

    /* ***** Content * Content * Content * Content * Content ***** */

    #Content {
    position:absolute;
    z-index:1;
    bottom:0;
    top:101px;
    left:215px;
    width:480px;
    text-align:justify;
    height:auto;
    border:1px solid black;
    padding:10px 10px 25px 10px;}

    #Content a:link {text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: #000000;
    line-height: normal;}

    #Content a:hover {color: #990000;}

    #Content a:visited {color: #990099;}

    #Content>p {margin:0;}

    #Content>p+p {text-indent:30px;}

    /* ***** Tabs * Tabs * Tabs * Tabs * Tabs * ***** */

    /*Sliding Doors Affect */

    #Tabs {
    position:relative;
    z-index:20;
    float:left;
    font-size:93%;
    line-height:normal;
    width:300px;
    margin: 0 0 0 110px;}

    html>body #Tabs {margin: 0 0 0 250px;}

    #Tabs ul {
    margin:0;
    padding:10px 0 0 10px;
    list-style:none;}

    #Tabs li {
    float:left;
    display:inline;
    margin:0;
    padding:0;}

    #Tabs a, #Tabs a:link, #Tabs a:visited{
    float: left;
    display:block;
    background:url("images/tab_l.gif") no-repeat left top;
    padding:5px 0 3px 2px;
    font-size:9px;
    color:#666666;
    }

    #Tabs a span {
    background: url("images/tab_r.gif") no-repeat right top;
    margin:0;
    padding:5px 5px 4px 3px;}
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #Tabs a {float:none;}
    /* End IE5-Mac hack */

    #Tabs #Current a, #Tabs #Current a:link, #Tabs #Current a:visited {
    color:#000099;
    background-position: 0% -21px;}

    #Tabs #Current a span {background-position: 100% -21px;}

    #Tabs a:hover {background-position: 0% -42px;}

    #Tabs a:hover span {background-position: 100% -42px;}

    /* ***** Menu * Menu * Menu * Menu * Menu * ***** */

    #Menu {
    position:absolute;
    top:101px;
    left:5px;
    width:200px;
    padding:0px;
    background-color:#eee;
    border:1px dashed #999;
    /* filter:alpha(opacity=60);*/
    /* Again, the ugly brilliant hack. */
    voice-family: "\"}\"";
    voice-family:inherit;
    width:200px;}

    /* Again, "be nice to Opera 5". */
    body>#Menu {width:200px;}

    #Menu a {
    color:#000099;
    font-weight:normal;
    font-size: 7pt;
    line-height:8pt;}

    #Menu a:hover {color:#000000;}

    #Menu ul {
    list-style:none outside;
    margin: 0px;
    padding: 10px 5px 10px 5px;}

    ************************************

    Danny

    P.S. - please post the code if you get this working correctly. Thank You!
    Last edited by drn1; 02-21-2005 at 09:30 PM. Reason: Rename Titles

  • #2
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Solution

    Okay, here is what I ended up having to do. Essentially I just got rid of the positioning of the majority of the elements. Moved some elements around, specifically the menu and floated almost everything else. Whether or not this is the best way to do it I'm not sure, but it worked . So for those of you who found this looking for a solution to the same problem here is the code for the working css page. The only thing in the HTML that got changed was that the menu got put in between the tabs and the content divs.

    CSS ****************** CSS ****************** CSS

    body {
    background: url(images/bg.gif) no-repeat;
    background-attachment:fixed;
    margin:0px;
    padding:0px;
    font-family:verdana, arial, helvetica, sans-serif;
    color:#333;}

    #Container {
    margin-left: 10px;
    /* right: auto; bottom: auto; margin-left: -370px; *** Include this comment section for centered page - won't work with 640 x 480*/}

    /* ***** Styles * Styles * Styles * Styles * Styles * ***** */

    h1 {text-align: left;
    margin:0px 0px 15px 0px;
    padding:0px;
    font-size:26px;
    line-height:26px;
    font-weight:bold;
    color:#ccc;}

    h3 {text-align: left;
    margin:0px 0px 10px 0px;
    padding:0px;
    font-size:16px;
    line-height:16px;
    font-weight:bold;
    color:#000000;}

    p { font:12px/20px verdana, arial, helvetica, sans-serif;
    margin:0 0 20px 0;
    padding:0px;}

    a { color:#09c;
    text-decoration:none;
    font-weight:bold;
    font-family:verdana, arial, helvetica, sans-serif;}

    a:link, a:visited {color:#09c;}

    a:hover {color:#000000;}

    img {border:1px solid #000000;}

    .noLink {
    color:#999999;
    text-decoration:none;
    font-family:verdana, arial, helvetica, sans-serif;}

    .letter {
    font-weight:bold;
    border:1px solid #CCCCCC;
    padding: 0 390px 0 2px;}

    .slideImage {
    padding: 0 0 10px 10px;
    border:0;
    float:right;}

    .footer {clear:both; padding-top:10px;}

    .list li {
    font:12px/20px verdana, arial, helvetica, sans-serif;
    margin:0;
    padding:0px;}

    .navButtons {float:right;}

    .navButtons img {
    border:0;
    margin: 0 0 0 5px;}

    /* ***** Title * Title * Title * Title * Title * ***** */

    #Title {
    background: url(images/PDI_bar.gif) no-repeat;
    padding: 72px 0 0 0;
    overflow: hidden;
    height: 0px !important; /* for most browsers */
    height /**/:72px; /* for IE5.5's bad box model */}

    /* ***** Content * Content * Content * Content * Content ***** */

    #Content {
    float:left;
    margin-top:-1px;
    width:480px;
    text-align:justify;
    border:1px solid black;
    padding:10px 10px 25px 10px;}

    #Content a:link {
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: #000000;
    line-height: normal;}

    #Content a:hover {color: #990000;}

    #Content a:visited {color: #990099;}

    #Content>p {margin:0;}

    #Content>p+p {text-indent:30px;}

    /* ***** Tabs * Tabs * Tabs * Tabs * Tabs * ***** */

    /*Sliding Doors Affect */

    #Tabs {
    position:relative;
    z-index:20;
    float:left;
    left:-37px !important;
    left:210px;
    font-size:93%;
    line-height:normal;
    width:100%;}

    html>body #Tabs {margin: 0 0 0 250px;}

    #Tabs ul {
    margin:0;
    padding:10px 0 0 10px;
    list-style:none;}

    #Tabs li {
    float:left;
    display:inline;
    margin:0;
    padding:0;}

    #Tabs a, #Tabs a:link, #Tabs a:visited{
    float: left;
    display:block;
    background:url("images/tab_l.gif") no-repeat left top;
    padding:5px 0 3px 2px;
    font-size:9px;
    color:#666666;
    }

    #Tabs a span {
    background: url("images/tab_r.gif") no-repeat right top;
    margin:0;
    padding:5px 5px 4px 3px;}
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #Tabs a {float:none;}
    /* End IE5-Mac hack */

    #Tabs #Current a, #Tabs #Current a:link, #Tabs #Current a:visited {
    color:#000099;
    background-position: 0% -21px;}

    #Tabs #Current a span {background-position: 100% -21px;}

    #Tabs a:hover {background-position: 0% -42px;}

    #Tabs a:hover span {background-position: 100% -42px;}

    /* ***** Menu * Menu * Menu * Menu * Menu * ***** */

    #Menu {
    float:left;
    left:5px;
    margin-top:-1px;
    margin-right:10px;
    width:200px;
    padding:0px;
    background-color:#eee;
    border:1px dashed #999;
    filter:alpha(opacity=60); /*IE */
    -moz-opacity: 0.60; /* mozilla*/
    /* Again, the ugly brilliant hack. */
    voice-family: "\"}\"";
    voice-family:inherit;
    width:200px;}

    /* Again, "be nice to Opera 5". */
    body>#Menu {width:200px;}

    #Menu a {
    color:#000099;
    font-weight:normal;
    font-size: 7pt;
    line-height:8pt;}

    #Menu a:hover {color:#000000;}

    #Menu ul {
    list-style:none outside;
    margin: 0px;
    padding: 10px 5px 10px 5px;}

    #Menu .current {font-weight:bold;}

    CSS ****************** CSS ****************** CSS

    Hope that helps you guys. Enjoy!

  • #3
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Use the code boxes to hold your code.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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