Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-28-2008, 02:32 PM   PM User | #1
Mr Creeky
New Coder

 
Join Date: Nov 2008
Location: Hatfield, England
Posts: 28
Thanks: 2
Thanked 0 Times in 0 Posts
Mr Creeky is an unknown quantity at this point
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
Mr Creeky is offline   Reply With Quote
Old 11-28-2008, 03:30 PM   PM User | #2
drhowarddrfine
Senior Coder

 
Join Date: Oct 2005
Posts: 1,340
Thanks: 0
Thanked 61 Times in 60 Posts
drhowarddrfine can only hope to improve
Validate and fix your html errors first. Then, ignore what IE is doing and get it working in FF.
drhowarddrfine is offline   Reply With Quote
Old 11-28-2008, 03:43 PM   PM User | #3
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
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.
tomws is offline   Reply With Quote
Old 11-28-2008, 04:08 PM   PM User | #4
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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
Excavator is offline   Reply With Quote
Old 11-28-2008, 04:29 PM   PM User | #5
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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
Excavator is offline   Reply With Quote
Old 11-29-2008, 12:34 AM   PM User | #6
Mr Creeky
New Coder

 
Join Date: Nov 2008
Location: Hatfield, England
Posts: 28
Thanks: 2
Thanked 0 Times in 0 Posts
Mr Creeky is an unknown quantity at this point
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 />"
Mr Creeky is offline   Reply With Quote
Old 11-29-2008, 02:49 AM   PM User | #7
drhowarddrfine
Senior Coder

 
Join Date: Oct 2005
Posts: 1,340
Thanks: 0
Thanked 61 Times in 60 Posts
drhowarddrfine can only hope to improve
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.
drhowarddrfine is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:44 AM.


Advertisement
Log in to turn off these ads.