There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Web Design & Development
Tag Cloud
adware audio bios blue screen boot bsod computer connection crash dell driver drivers error excel firefox freeze freezing google hard drive hardware hijackthis install internet laptop linux malware network no sound outlook problem reboot router screen server slow sound speakers spyware startup trojan usb video virus vista webcam windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: CSS and IE vs FireFox

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
pcpro17's Avatar
Senior Member with 368 posts.
 
Join Date: Oct 2006
Location: Grafton, WI, USA
Experience: Advanced
27-May-2007, 06:36 PM #1
Exclamation Solved: CSS and IE vs FireFox
Hello. Can someone please assist me with adjusting my style sheet so that what it generates in IE will be the same (or at least similar) to what is generated in FireFox? I'm using the latest versions of both.

Go to the following site on FireFox to see how badly FireFox messes it up:

http://test.correctnesscommentary.com/

Now go to the same site with IE to see the beautiful new layout. I'd like it to look that that in FireFox as well.

Here is my CSS:
Code:
body           {
  background-color:      <?php print($bodybg); ?>;
  text-align:            center;
  margin:                0px;
  padding:               0px;
  width:                 100%;
  min-width:             900px;
  }

div.container  {
  background-color:      <?php print($containerbgcolor); ?>;
  text-align:            center;
  margin:                0px;
  padding:               0px;
  border-left:           1px solid <php? print($containerborder); ?>;
  border-right:          1px solid <php? print($containerborder); ?>;
  width:                 900px;
  }
div.header     {
  background-image:      url(images/banner.jpg);
  background-position:   center top;
  background-repeat:     no-repeat;
  margin:                10px 0px 15px 0px;
  padding:               0px;
  width:                 100%;
  height:                150px;
  }
div.leftbar    {
  float:                 left;
  text-align:            center;
  margin:                0px 0px 0px 50px;
  padding:               0px;
  width:                 200px;
  background-color:      <?php print($sidebarbg); ?>;
  }
div.infobox    {
  text-align:            left;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px 0px 1px 0px;
  padding:               5px;
  width:                 100%;
  border:                1px solid <?php print($infoboxborder); ?>;
  background-color:      <?php print($infoboxbg); ?>;
  }
div.content    {
  float:                 right;
  text-align:            left;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px 50px 10px 0px;
  padding:               5px;
  width:                 590px;
  border:                0px;
  border-top:            1px solid <?php print($contentborder); ?>;
  border-top-width:      60%;
  border-left:           3px solid <?php print($contentborder); ?>;
  background-color:      <?php print($contentbg); ?>;
  }
div.footer     {
  text-align:            center;
  font:                  normal 8pt arial, serif;
  color:                 <?php print($h6color); ?>;
  margin:                0px;
  padding:               10px 0px 0px 0px;
  width:                 800px;
  }
Any suggestions are appreciated. Thanks!
dudeking's Avatar
Computer Specs
Senior Member with 419 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: I'm Pro...
28-May-2007, 07:25 AM #2
div.container {
background-color: <?php print($containerbgcolor); ?>;
text-align: center;
margin: 0px auto;
padding: 0px;
border-left: 1px solid <php? print($containerborder); ?>;
border-right: 1px solid <php? print($containerborder); ?>;
width: 900px;
}

margin auto should fix it, only difference i can see is that it isnt centered.
pcpro17's Avatar
Senior Member with 368 posts.
 
Join Date: Oct 2006
Location: Grafton, WI, USA
Experience: Advanced
28-May-2007, 04:42 PM #3
Hi Eddie. Thanks for the suggestion! That's definately an improvement! There are two other issues that need to be addressed as well. The banner also needs to be center-aligned. It centers just fine in IE, but FireFox doesn't seem to like the way I'm defining it (in the 'header' div). Also, for some reason FireFox is squeezing the footer under the left column, even though I have its width specified at 800px. Any ideas?
Code:
body           {
  background-color:      <?php print($bodybg); ?>;
  text-align:            center;
  margin:                0px;
  padding:               0px;
  width:                 100%;
  min-width:             900px;
  }

div.container  {
  background-color:      <?php print($containerbgcolor); ?>;
  text-align:            center;
  margin:                0px auto;
  padding:               0px;
  border-left:           1px solid <php? print($containerborder); ?>;
  border-right:          1px solid <php? print($containerborder); ?>;
  width:                 900px;
  }
div.header     {
  background-image:      url(images/banner.jpg);
  background-position:   center top;
  background-repeat:     no-repeat;
  margin:                10px 0px 15px 0px;
  padding:               0px;
  width:                 800px;
  height:                150px;
  }
div.leftbar    {
  float:                 left;
  text-align:            center;
  margin:                0px 0px 0px 50px;
  padding:               0px;
  width:                 20%;
  background-color:      <?php print($sidebarbg); ?>;
  }
div.infobox    {
  text-align:            left;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px 0px 1px 0px;
  padding:               5px;
  width:                 100%;
  border:                1px solid <?php print($infoboxborder); ?>;
  background-color:      <?php print($infoboxbg); ?>;
  }
div.content    {
  float:                 right;
  text-align:            left;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px 50px 10px 0px;
  padding:               5px;
  width:                 65%;
  border:                0px;
  border-top:            1px solid <?php print($contentborder); ?>;
  border-top-width:      60%;
  border-left:           3px solid <?php print($contentborder); ?>;
  background-color:      <?php print($contentbg); ?>;
  }
div.googlesearch {
  float:                 right;
  text-align:            left;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px 50px 10px 0px;
  padding:               5px;
  width:                 65%;
  border:                0px;
  background-color:      <?php print($containerbgcolor); ?>;
  }
div.footer     {
  text-align:            center;
  font:                  normal 8pt arial, serif;
  color:                 <?php print($h6color); ?>;
  margin:                0px;
  padding:               10px 0px 0px 0px;
  width:                 800px;
  min-width:             800px;
  }
Thanks!
deepdiver01's Avatar
Senior Member with 732 posts.
 
Join Date: Dec 2004
Location: Cairns, Australia
Experience: Intermediate
28-May-2007, 05:15 PM #4
Me again.

Paul O'B has put out a great 3 column layout that performs extremely well and addresses the issues associated with 3 col layouts in CSS.

You can find the code and an explanation here http://www.pmob.co.uk/temp/3colfixedtest_explained.htm

I have used this layout many times without any problems, apart from the ones I caused.

The explanation gives a great insight into how the elements work and hopefully will help.

Deep.
__________________
Six mumfs ago I coodnt spel injineer. Now I are wun.

Domain Names, Web Hosting
Free Online Games | Free Flash Games
Australian Domain Names
Motor Finance Wizard Information Base
pcpro17's Avatar
Senior Member with 368 posts.
 
Join Date: Oct 2006
Location: Grafton, WI, USA
Experience: Advanced
31-May-2007, 04:34 PM #5
Thanks, Deep, for the suggestion! I think most of the layout issues have been resolved. Right now, there are two issues remaining:

1. FireFox is forcing the height of a 'content' division to be at least a certain height, which I want most of the time, but not always. The issue I would really like to fix here that would eliminate the need for a 'min-height' specification is in IE when I set an 'img' to 'float:left;' the bottom of the division (where the actual text [that does wrap properly to the right of the image] ends) crops whatever is left of the bottom of the image.

2. For some reason FireFox does not place the 'googlesearch' division at the end of the 'contentbar' division. It just throws it on top of everything at the top of the 'contentbar'. Any suggestions on how to fix this would be appreciated. My CSS defining the layout follows:
Code:
body           {
  background-color:      <?php print($bodybg); ?>;
  text-align:            center;
  margin:                0px;
  padding:               0px;
  width:                 100%;
  min-width:             900px;
  }

div.container  {
  background-color:      <?php print($containerbgcolor); ?>;
  text-align:            center;
  margin:                0px auto;
  padding:               0px 50px;
  border-left:           1px solid <php? print($containerborder); ?>;
  border-right:          1px solid <php? print($containerborder); ?>;
  width:                 900px;
  }
div.header     {
  background-image:      url(images/banner.jpg);
  background-position:   center top;
  background-repeat:     no-repeat;
  margin:                0px auto;
  margin:                10px 0px 0px 0px;
  padding:               0px 50px;
  width:                 100%
  height:                150px;
  height:                expression(document.body.header = "150px");
  }
div.midsection {
  float:                 left;
  text-align:            center;
  margin:                0px auto;
  padding:               0px;
  width:                 100%
  }
div.leftbar    {
  float:                 left;
  text-align:            center;
  margin:                0px auto;
  margin:                10px 0px;
  padding:               0px;
  width:                 200px;
  }
div.infobox    {
  text-align:            left;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px;
  padding:               5px;
  width:                 100%;
  border:                1px solid <?php print($infoboxborder); ?>;
  border-bottom-width:   3px;
  background-color:      <?php print($infoboxbg); ?>;
  }
div.googlead   {
  text-align:            center;
  margin:                0px auto;
  margin-top:            50px;
  padding:               0px;
  width:                 100%;
  border:                0px;
  }
div.contentbar {
  float:                 right;
  text-align:            left;
  margin:                0px;
  margin:                10px 0px;
  padding:               0px;
  }
div.content    {
  text-align:            left;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px;
  margin-bottom:         10px;
  padding:               5px;
  width:                 580px;
  min-width:             580px;
  width:                 expression(document.body.content = "580px" );
  min-height:            275px;
  height:                expression(document.body.content < 275 ? "275px" : "1%");
  border:                0px;
  border-top:            1px solid <?php print($contentborder); ?>;
  border-left:           3px solid <?php print($contentborder); ?>;
  background-color:      <?php print($contentbg); ?>;
  }
div.googlesearch {
  text-align:            center;
  font:                  normal 10pt arial, serif;
  color:                 <?php print($textcolor); ?>;
  margin:                0px auto;
  padding:               5px;
  width:                 100%;
  border:                0px;
  background-color:      <?php print($containerbgcolor); ?>;
  }
div.footer     {
  text-align:            center;
  font:                  normal 8pt arial, serif;
  color:                 <?php print($h6color); ?>;
  margin:                0px auto;
  padding:               0px 50px;
  min-width:             800px;
  width:                 expression(document.body.footer < 800 ? "800px" : "100%");
  }
Thanks!
pcpro17's Avatar
Senior Member with 368 posts.
 
Join Date: Oct 2006
Location: Grafton, WI, USA
Experience: Advanced
05-Jun-2007, 12:18 PM #6
bump
pcpro17's Avatar
Senior Member with 368 posts.
 
Join Date: Oct 2006
Location: Grafton, WI, USA
Experience: Advanced
20-Jul-2007, 10:17 AM #7
This issue is basically resolved. Apparently these W3C-compliant browsers like to have the height of block elements specified.
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 08:08 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.