CSS Potitioing Help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

CSS Potitioing Help

Post by cupaball »

Hi All:

I am trying to learn CSS and have created a mock up site to learn positioning. The layout looks fine in FIreFox but is off by few pixels in IE7. Can someone look at the files and tell me what I am doing wrong. Maybe I used the wrong positioning technique.

Hope you can help.
Attachments
CSS TEST.zip
(31.91 KiB) Downloaded 66 times
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: CSS Potitioing Help

Post by Christopher »

Typically the problem is the problems with IE's box model. The solution is to not use padding and margins together. Wrap and extra <div> around the problem area and put the margin in it.
(#10850)
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Re: CSS Potitioing Help

Post by cupaball »

I think I still may be doing something wrong. Can some take a look for me? I added another div, but it still looks the same. I attached an updated file.
Attachments
CSS TEST.rar
(30.74 KiB) Downloaded 58 times
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: CSS Potitioing Help

Post by Christopher »

For a start just do:

Code: Select all

div#logo_1 {
float:left;
width: 230px;
}
 
#logo_2 {
float:left;
width: 230px;
}
 
I leave it to you to sort out the margins. I would recommend floating elements rather than absolute positioning.
(#10850)
cupaball
Forum Commoner
Posts: 85
Joined: Sun Feb 12, 2006 1:46 pm

Re: CSS Potitioing Help

Post by cupaball »

arborint wrote:For a start just do:

Code: Select all

div#logo_1 {
float:left;
width: 230px;
}
 
#logo_2 {
float:left;
width: 230px;
}
 
That did it. I updated the file and validated my xhtml.
Attachments
CSS TEST.rar
(30.88 KiB) Downloaded 55 times
Post Reply