By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,968 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,968 IT Pros & Developers. It's quick & easy.

DIV Vertical Alignment off in Firefox

P: 3
Okay, so here is my issue. I have done a W3C validation and the errors I get are mostly alt or shorttag, doesn't appear to be anything connected to this problem.

You can view the site at www.michiganequality.org/index.htm

Basically, the site views properly in IE, however, in Firefox the rightsidemain div does not align back at the top of the containerbody div, but rather aligns where the leftside div left off.

Now, the site was working properly until I changed some code regarding the flash menu. I wanted it to be more accessible to those without flash and for SEO and utilized SWFObject to display alternate content when flash was not detected. Once I did that, however, this problem showed up.

Here is the CSS code:
Expand|Select|Wrap|Line Numbers
  1. #containerbody { 
  2.     display: table;
  3.     position: relative;
  4.     text-align: center;
  5.     background-image: url('http://www.michiganequality.org/siteimages/columngif.gif');
  6.     padding: 0px 0px 0px 0px;  
  7.     margin: 0 auto; 
  8.     width: 893px;
  9.     height: 100%;
  10.     }
  11. #leftside { 
  12.     float:left;
  13.     background: #000000; 
  14.     padding: 0px 0px 0px 0px;  
  15.     margin: 0 auto; 
  16.     width: 139px; 
  17.     }
  18. #rightside { 
  19.     font-family: Verdana, Arial, Helvetica, sans-serif;
  20.     margin: 0px 0px 0px 0px;
  21.     font-size: 11px;
  22.     line-height: 19px;
  23.     color: #000000;
  24.     float:right;
  25.     text-align: left;
  26.     background: #ffffff; 
  27.     padding: 23px 33px 21px 33px; 
  28.     width: 688px; 
  29.     }
  30. .rightside2 { 
  31.     font-family: Verdana, Arial, Helvetica, sans-serif;
  32.     margin: 8px 0px 0px 0px;
  33.     font-size: 11px;
  34.     line-height: 19px;
  35.     color: #000000;
  36.     }
  37.     #rightsidemain { 
  38.     font-family: Verdana, Arial, Helvetica, sans-serif;
  39.     margin: 0 auto;
  40.     font-size: 11px;
  41.     line-height: 19px;
  42.     color: #000000;
  43.     float:right;
  44.     text-align: left;
  45.     vertical-align: top;
  46.     background: #ffffff; 
  47.     padding: 0px 0px 0px 0px; 
  48.     width: 754px; 
  49.     }
The HTML calls forth containerbody, then leftside within. Within leftside it calls the alternate div for the flash menu, then closes both the alternate and leftside and open the rightsidemain div. Finally closing both rightsidemain and containerbody div.

Any ideas why the rightsidemain is not aligning to the top? I'm stumped. Thanks in advance!
Jun 16 '08 #1
Share this Question
Share on Google+
4 Replies


drhowarddrfine
Expert 5K+
P: 7,435
Okay, so here is my issue. I have done a W3C validation and the errors I get are mostly alt or shorttag, doesn't appear to be anything connected to this problem.
Shorttag errors can be very significant. In addition, they show you are declaring transitional HTML but using XHTML tags. Plus you have a CSS error that needs fixing.

Having a valid web page does not mean your page will display correctly. It only means you used the correct syntax.

Why are you using transitional? New pages have no need for the transitional doctype.

Do not look at Firefox and ask why it doesn't work like old, broken, non-standard IE, but ask why is IE doing not acting like Firefox. Firefox is the standard to follow, never IE.

There is no such thing as "language=javascript". Also, showing the CSS alone does no good but the link you show is all that is needed.
Jun 16 '08 #2

P: 3
Actually I went through this morning and fixed all the validation errors. It is now all validated. Honestly, I took over the site from the original designer as the owners weren't happy with the response time, so I just left the doctype in there as it originally was. Do you have a recommendation as to what it should be? I was reading more about it this morning, but couldn't figure out what doctype I should be using.

What is the CSS error? I can't seem to find it.

I wasn't trying to make it work from what IE has, it's just that oddly enough it does what I want it to do in IE but not in Firefox.

Thanks for the help.
Jun 16 '08 #3

drhowarddrfine
Expert 5K+
P: 7,435
Yes, I noticed things had changed compared to what you stated.
Negative numbers are not allowed on padding.

It's more difficult to change the doctype after a page is created. That's why I said "new pages" should not use transitional since the only purpose of that doctype is to allow for deprecated elements. All new pages should always use 'strict' but changing to strict now may change the look of your page.
Jun 16 '08 #4

P: 3
Negative numbers are not allowed on padding.
Oh right, I fixed that. That was actually in the css sheet used for printing. Nevertheless, still encountering the same problem.
Jun 16 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.