Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 12-28-2008, 08:08 PM Position divs
Junior Talker

Posts: 2
Name: Dan
Trades: 0
Hi,
I'm am trying to make a tableless designed webpage but I'm strugling a bit in positioning the divs.
Lets say I want 3 divs (1 menu, 1 main, and 1 right) on a page. The page must be optimized for a specific screenresolution. Lets say 1000pixels to make it easy. In case the monitor is larger the 3 divs must be in the center of the screen (ex. 1600px monitor - the first div must start at 301px and the last must go to 1300px)
What I'm trying to do is to something likje this:
<div style="text-align: center;">
<div style="text-align: center; width:1000px">
<div style="width: 200px ;position:absolute; left: 0px"></div>
<div style="width: 700px ;position:absolute; left: 200px"></div>
<div style="width: 100px ;position:absolute; right: 0px"></div>
</div>
</div>
Just an example. The problem is that I cannot use position:absolute because it uses the whole page as pixel-reference and therefore ignores the alignment of center and puts the divs in the site-position instead of the parent-div. Does I use position:relative it will use the parent div but it will position the divs in a new line each. and the top-property set to minus X will just merge them into eachother instead of position them after eachother horizontally as I would like it.
Any surgestions on how to do this wihout using a table.
sniper83 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-28-2008, 08:13 PM Re: Position divs
Novice Talker

Posts: 5
Trades: 0
Check this and this
dudaah is offline
Reply With Quote
View Public Profile
 
Old 12-28-2008, 08:50 PM Re: Position divs
Junior Talker

Posts: 2
Name: Dan
Trades: 0
Thanks a lot..
sniper83 is offline
Reply With Quote
View Public Profile
 
Old 12-30-2008, 03:21 PM Re: Position divs
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
#1 - do NOT use all that absolute positioning, it WILL cause you headaches you don't want.

#2 - use floats instead to achieve your layout

#3 - check the stickies for how to center your layout.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Position divs
 

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.17887 seconds with 12 queries