Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 01-15-2007, 07:42 AM   #1
Member (9 bit)
 
Join Date: Nov 2002
Location: London, UK
Posts: 288
How do I position a <div> relative to a <div> wrapper?

Hi,
I have created a site which uses css for structure.

I am using a div id="wrapper" to contain other divs
The design is a three column page with a header-banner running across the top of the left and centre column but with the right column stretching from the top to the bottom of the wrapper.

I want the main wrapper to be a specific width, with a variable height, and to center on the page.

To ensure that separate divs don't get out of position I thought it best to give them positions within the wrapper - relative to the wrapper. BUT cannot figure out how to do this since the wrapper's position is centered according to windows size and therefore not specific.

Please help.
Thanks for reading.

Last edited by Londoner; 01-15-2007 at 07:51 AM.
Londoner is offline   Reply With Quote
Old 01-15-2007, 10:13 PM   #2
Member (9 bit)
 
mattmorgan's Avatar
 
Join Date: Dec 2001
Location: Bournemouth
Posts: 276
Hi there, 3rd year interactive media student, so i dont pretend to know it all but what i use is a div wraped around that all my others like this:

css code:

#centre{
margin-left:auto;
margin-right:auto;
width:1024px;
}

div code:

< div id ="centre" >[YOUR SITE HERE]< /div >

( remove the spaces, i had to add them to make the code show up )
works for me. any good to you? if not point me in the direction of your site, and i'll check the source code, write it, then send it back.



hope it helps.

M@
__________________
System Spec:

WinXP MediaCentre - Intel Nehalem i7 920 S1366 2.66GHz, Gigabyte GA-EX58-UD5, Nvidia 8800GTS 640Mbs DDR3, Corsair Memory 4GB (2X2GB KIT) DDR3 1600MHZ 240PIN UNBUFFERED, 4 x Seagate Barracuda 7200.11 1TB 7200RPM, OCZ Technology StealthXStream, Antec Black Twelve Hundred Tower Case, LG Electronics Blu-Ray/HD DVD-ROM COMBO 16x DVD+/-RW, 2x Acer 24" Wide V243W 5ms LCD TFT

Last edited by mattmorgan; 01-15-2007 at 10:16 PM.
mattmorgan is offline   Reply With Quote
Old 01-16-2007, 07:27 AM   #3
Member (9 bit)
 
Join Date: Nov 2002
Location: London, UK
Posts: 288
Quote:
Originally Posted by mattmorgan
Hi there, 3rd year interactive media student, so i dont pretend to know it all but what i use is a div wraped around that all my others like this:

css code:

#centre{
margin-left:auto;
margin-right:auto;
width:1024px;
}

div code:

< div id ="centre" >[YOUR SITE HERE]< /div >

( remove the spaces, i had to add them to make the code show up )
works for me. any good to you? if not point me in the direction of your site, and i'll check the source code, write it, then send it back.



hope it helps.

M@

That works!

At last - I thought I'd tried everything!
Londoner is offline   Reply With Quote
Old 01-16-2007, 07:30 AM   #4
Member (9 bit)
 
mattmorgan's Avatar
 
Join Date: Dec 2001
Location: Bournemouth
Posts: 276
cool! any more problems drop me a line.

good luck.

M@
mattmorgan is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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



All times are GMT -5. The time now is 05:17 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2