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 7 of 7
  1. #1
    New Coder
    Join Date
    Nov 2008
    Location
    Hatfield, England
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Macintosh Background only showing up in IE

    Made a simple page after spending hours on my main page trying to fix this problem.

    When I add float:left; & float:right; The background color of #fff disappears but only in anything other than IE.

    This is my first attempt at a site without using <table> at all so be kind

    http://www.caitsolutions.com/test.html

  • #2
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    Validate and fix your html errors first. Then, ignore what IE is doing and get it working in FF.

  • #3
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Get and use the Firebug extension for Firefox. One good thing about it is that when you bring up the html and hover your mouse over the tags, you see where the browser is placing your containers - and it's not always where you think they should be.

    In your case, the div containing the 2 lists collapses - it doesn't wrap the 2 lists as you'd expect. That's why you're not seeing the white background. Adding a <div style="clear:both"></div> after the last ul "stretches" it again to contain the two lists. After using floats, be sure to use a clear.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello Mr Creeky,
    This will clear your floats -
    Code:
    #wrapper {
    	width:760px;
    	overflow:auto;
    	margin: 15px auto 0px auto;
    	text-align:left;
    	background-color: #FFF;
    }
    Read about that here.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Instead of using a ul to float your text left/right it might be better to use divs. Like this -
    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>CSS Test</title>
    <style type="text/css">
    body {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 14px;
    	color: #000;
    	background: #E3EEF9 url(http://www.caitsolutions.com/images/layout/sky.png) repeat-x;
    }
    * {
    	margin: 0;
    	padding: 0;
    }
    #wrapper {
    	overflow: auto;
    	width: 760px;
    	margin: 15px auto 0px auto;
    	text-align: left;
    	background: #FFF;
    }
    #leftside {
    	margin: 10px 0 0 10px;
    	width: 380px;
    	float: left;
    }
    #rightside {
    	margin: 10px 10px 0 0;
    	width: 330px;
    	float: right;
    }
    #wrapper p {
    	margin-top: 15px;
    }
    </style>
    </head>
    <body>
    <div id="wrapper">
        <div id="leftside">
            <p>
            	Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh 
                euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad 
                minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut 
                aliquip ex ea commodo consequat.
            </p>  
            <p>
            	Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh 
                euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad 
                minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut 
                aliquip ex ea commodo consequat.
            </p>  
        <!--end leftside--></div>
        <div id="rightside">
            <p>
            	Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh 
                euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad 
                minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut 
                aliquip ex ea commodo consequat.
            </p>  
            <p>
            	Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh 
                euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad 
                minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut 
                aliquip ex ea commodo consequat.
            </p>  
            <p>
            	Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh 
                euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad 
                minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut 
                aliquip ex ea commodo consequat.
            </p>  
        <!--end rightside--></div>
    <!--end wrapper--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    New Coder
    Join Date
    Nov 2008
    Location
    Hatfield, England
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks for your help guys, i have got the page working now.

    I looked at the html Validate but did not understand the errors it said that page has. To me the page looked ok but it gave an error on things like this, "<br /><br />"

  • #7
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    I don't see that error but what do you not understand? It says you are missing tags and the places you are missing them. Even though the page looks OK now doesn't mean it will stay that way as you add things or it will look good in every browser.


  •  

    Posting Permissions

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