Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

Alignment Problems with CSS

This is a discussion on "Alignment Problems with CSS" within the Web Page Design section. This forum, and the thread "Alignment Problems with CSS are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 2nd, 2008, 04:52
New Member
Join Date: Jul 2008
Location: Tallahassee, FL
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Question Alignment Problems with CSS

Hello - I'm starting to get familiar with CSS, and I'm stumped on a site design. The site is http://www.thekennylawfirm.com/demo2.

I've used CSS to create a black inner area that runs from top to bottom of the page. In Internet Explorer, the black inner area appears properly. However, when viewing the site in Firefox, the black inner area doesn't appear to be as wide as the area above it.

I'm not sure if I'm missing something simple, or if my overall logic is defunct. Thanks for any advice!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Jul 2nd, 2008, 14:25
Junior Member
Join Date: Mar 2008
Location: Lisburn, Northern Ireland
Age: 28
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Alignment Problems with CSS

I'm actually suffering from the same problem myself in that a pair of input fields are appearring at different distances across the page. Firefox and IE7 unfortunately render CSS instructions differently so you're bound to get anomalies like that.

What I am doing is preparing the page so it looks correct in Firefox, then using a browser detect to check for IE (I think the Firefox version will appear identical in Opera and Safari but haven't checked yet) and loading an IE specific stylesheet.

Someone else may have a better way but that's how I plan to tackle the problem if I can fix up a few other more important things first.

Hope that helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 2nd, 2008, 14:49
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: Alignment Problems with CSS

You have some ID's used multiple times, you can only use and ID once per page. Problem is IE will render bad code FF will not. So in this case FF is rendering the page correctly while IE is doing so incorrectly. Check your source, clean up any errors and see if that doesn't fix it.
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 5th, 2008, 18:20
New Member
Join Date: Jul 2008
Location: Tallahassee, FL
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Alignment Problems with CSS

Quote:
Originally Posted by moojoo View Post
You have some ID's used multiple times, you can only use and ID once per page. Problem is IE will render bad code FF will not. So in this case FF is rendering the page correctly while IE is doing so incorrectly. Check your source, clean up any errors and see if that doesn't fix it.
Thanks, moojoo. I found duplicative "contentarea" and "mainarea" id tags, and named the duplicates "contentarea2" and "mainarea2". I also copied the CSS and duplicated that with the "2" also. Didn't fix the problem. Maybe I still have something duplicated somewhere?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 5th, 2008, 18:21
New Member
Join Date: Jul 2008
Location: Tallahassee, FL
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Alignment Problems with CSS

Quote:
Originally Posted by Crow555 View Post
I'm actually suffering from the same problem myself in that a pair of input fields are appearring at different distances across the page. Firefox and IE7 unfortunately render CSS instructions differently so you're bound to get anomalies like that.

What I am doing is preparing the page so it looks correct in Firefox, then using a browser detect to check for IE (I think the Firefox version will appear identical in Opera and Safari but haven't checked yet) and loading an IE specific stylesheet.

Someone else may have a better way but that's how I plan to tackle the problem if I can fix up a few other more important things first.

Hope that helps.
Thanks, Crow. Sounds like a good plan, but I can't figure out what is actually screwing up the code in FF, so I can't narrow down the problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 6th, 2008, 23:39
Up'n'Coming Member
Join Date: Jun 2008
Location: Australia
Posts: 80
Thanks: 0
Thanked 4 Times in 4 Posts
Re: Alignment Problems with CSS

A good rule of thumb, is if it breaks in FF but not in IE, its probably mixed up code that IE is happy to interpret but FF isn't. Best thing you can do is run your HTML and CSS files through the W3C validator (http://jigsaw.w3.org/css-validator/) and fix any issues there. ID's used twice would have been picked up straight away.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jul 6th, 2008, 23:49
Up'n'Coming Member
Join Date: Jun 2008
Location: Australia
Posts: 80
Thanks: 0
Thanked 4 Times in 4 Posts
Re: Alignment Problems with CSS

You are missing a closing div tag at the end, right before the /body tag. Its best to keep your code indented propperly so that you can always debug this kind of thing. Also, the validator would have found this problem for you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
The Following User Says Thank You to Grubious For This Useful Post:
  #8  
Old Jul 7th, 2008, 01:12
Reputable Member
Join Date: Mar 2008
Location: Chester, UK
Age: 18
Posts: 465
Thanks: 2
Thanked 33 Times in 33 Posts
Re: Alignment Problems with CSS

Quote:
I found duplicative "contentarea" and "mainarea" id tags, and named the duplicates "contentarea2" and "mainarea2". I also copied the CSS and duplicated that with the "2" also.
You would of been better just changing them to classes, you can call a class multiple times per page

like so...

Code: Select all
<div class="contentarea"><p>content</p></div>
and for the css, just change the #contentarea to .contentarea

That saves duplicating information, which saves on file size which will save you a fair bit of bandwidth (which you pay for).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
alignment, css

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down menu alignment problems. Div wont vertically align. Itsumishi Web Page Design 7 Mar 4th, 2008 05:57
tricky floating problems for div alignment escaflowne11 Web Page Design 4 Dec 10th, 2006 09:03
CSS Newbie: Firefox alignment problems SuperGrover1981 Web Page Design 1 Aug 31st, 2006 11:28
alignment problems joojoo Web Page Design 7 Aug 15th, 2006 09:55
Two problems - image alignment and new browser windows. DrRedSkwirrell Web Page Design 9 Oct 29th, 2005 01:51


All times are GMT. The time now is 19:18.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8