Reply
Absolute or relative positioning for fixed width?
Old 10-12-2009, 09:13 PM Absolute or relative positioning for fixed width?
WebTraffic's Avatar
Extreme Talker

Posts: 215
Name: Brandon
Trades: 0
When designing a fixed size layout, I know that the container that holds everything needs to be relative positioned in order to be centered on both sides.

Should the contents inside the container be absolute or relative? I read an article saying that absolute positioned divs would mess the layout up in different browsers, but is this the case if it is inside of a relative div?
__________________
Coding is just like a woman. If you don't do something exactly right, it complains.
WebTraffic is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 10-13-2009, 09:30 AM Re: Absolute or relative positioning for fixed width?
chrishirst's Avatar
Super Moderator

Posts: 22,281
Location: Blackpool. UK
Trades: 0
Absolutely positioned elements inside a positioned parent will take their settings from the position of the parent.

BUT it is MUCH better to use the normal document flow rather than positioning every element on the page. The only time you should need to position any element, is when it has to move out of it's natural position.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-13-2009, 11:19 AM Re: Absolute or relative positioning for fixed width?
WebTraffic's Avatar
Extreme Talker

Posts: 215
Name: Brandon
Trades: 0
Okay so it IS possible to design using only relative div's. I'm not that far along with CSS to understand how to position them with relative positioning, but I am sure that that would definitely be something that I should work on.
__________________
Coding is just like a woman. If you don't do something exactly right, it complains.
WebTraffic is offline
Reply With Quote
View Public Profile
 
Old 10-13-2009, 12:57 PM Re: Absolute or relative positioning for fixed width?
chrishirst's Avatar
Super Moderator

Posts: 22,281
Location: Blackpool. UK
Trades: 0
No, no, you don't need to use relative positioning either

A quickly thrown together page using only one positioned element - the "wrapper" container.

http://www.modtalk.co.uk/_site/code/...ioning/static/
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-13-2009, 05:02 PM Re: Absolute or relative positioning for fixed width?
LadynRed's Avatar
Super Moderator

Posts: 8,823
Location: Tennessee
Trades: 0
You also need to understand that IE7 and 6 have a MAJOR problem with nesting positioned elements, so it's best to stay away from positioning everything as Chris has already stated.
http://www.positioniseverything.net/posbugs.html and http://www.positioniseverything.net/abs_relbugs.html

Flow vs. Positioning article..

http://www.vision.to/the-difference-...ositioning.php
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-13-2009, 05:43 PM Re: Absolute or relative positioning for fixed width?
WebTraffic's Avatar
Extreme Talker

Posts: 215
Name: Brandon
Trades: 0
Thanks for the links, I will be sure to read them when I get home. I have noticed the problem with IE...

The website looks fine on my monitor in all resolutions in firefox but IE tears it apart.

Is there a way around this?
__________________
Coding is just like a woman. If you don't do something exactly right, it complains.
WebTraffic is offline
Reply With Quote
View Public Profile
 
Old 10-14-2009, 04:31 PM Re: Absolute or relative positioning for fixed width?
LadynRed's Avatar
Super Moderator

Posts: 8,823
Location: Tennessee
Trades: 0
What version of IE ?
Got a url of the problem ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-14-2009, 04:36 PM Re: Absolute or relative positioning for fixed width?
Brian07002's Avatar
Defies a Status

Posts: 1,599
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by WebTraffic View Post
Okay so it IS possible to design using only relative div's. I'm not that far along with CSS to understand how to position them with relative positioning, but I am sure that that would definitely be something that I should work on.
If you are able to get a hold of Microsoft Front Page 2003 and toy with that program, you will find out how easy it is to position elements on the screen via div tags. It's an old program, but FP2003 was the last version of front page (html editor). It came in 2000 and 2003 versions, but 2003 is great for visually placing divs on you page. You can really get used to using divs in that program.
__________________
Sig Less - Have some site you want me to put here? Will put here for a couple of paypal bucks.
Brian07002 is online now
Reply With Quote
View Public Profile
 
Old 10-15-2009, 11:16 AM Re: Absolute or relative positioning for fixed width?
LadynRed's Avatar
Super Moderator

Posts: 8,823
Location: Tennessee
Trades: 0
Quote:
If you are able to get a hold of Microsoft Front Page 2003 and toy with that program, you will find out how easy it is to position elements on the screen via div tags.
EGADS.. NOOOOOOOOOOOOOOOOOOO!!! Not that HORRID program! Besides, all it will do is create a web page that ONLY works in IE!!
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Absolute or relative positioning for fixed width?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.13541 seconds with 13 queries