Old 09-06-2008, 15:04   #1 (permalink)
cyrus_thevirus
Registered User
 
Join Date: Jun 2008
Posts: 3
Help!!! DIV/CSS Layout

I'm trying to create a layout using divs and css. The layout is rendered correctly on IE but differently on other browsers(Firefox,Opera). The main problem is that I defined a white background-color for the content(id="dashboard" ) and a dark gray color for the body background-color. IE is the only browser that seems to recognize the white background. What am I doing wrong? Any help is appreciated.

I have attached screen shots of how it looks on recent versions of ie and firefox

Also attached is the html code.
Attached Thumbnails
help-div-css-layout-ielook.jpg  help-div-css-layout-firefoxlook.jpg  
Attached Files
File Type: txt index.txt (1.9 KB, 17 views)
  Reply With Quote
Old 09-06-2008, 15:18   #2 (permalink)
pilola
Registered User
 
Join Date: Jun 2008
Posts: 2
Try using overflow:hidden in your container/wrapper. Think it's div.c5 in your code.
  Reply With Quote
Old 09-06-2008, 15:26   #3 (permalink)
cyrus_thevirus
Registered User
 
Join Date: Jun 2008
Posts: 3
Quote:
Originally Posted by pilola
Try using overflow:hidden in your container/wrapper. Think it's div.c5 in your code.
Wow!! that worked. Thanks pilola. Do you mind explaining why that made a difference?
  Reply With Quote
Old 09-06-2008, 15:44   #4 (permalink)
pilola
Registered User
 
Join Date: Jun 2008
Posts: 2
Quote:
Originally Posted by cyrus_thevirus
Wow!! that worked. Thanks pilola. Do you mind explaining why that made a difference?



You simply have to do that so that the browser(s) understand that the Div is actually "wrapping around" the other div's that you are floating. The reason that it worked in IE (Im guessing IE 6) is that it in some cases like to let sloppy code work.

You can use overflow: auto too but. I prefer hidden because it's what I've always used.
  Reply With Quote
Old 09-06-2008, 15:59   #5 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Be aware that float clearing method does not work 100% of the time and causes problems from time to time. I much prefer the generated content method or the FnE (float nearly everything) method.
  Reply With Quote
Old 09-06-2008, 16:07   #6 (permalink)
cyrus_thevirus
Registered User
 
Join Date: Jun 2008
Posts: 3
Thanks! everyone for the valuable input.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8