Jump to content

DIV Support - Center content


Drainy

Recommended Posts

Hi,

 

Ive had a look through the other DIV questions but I think mine might be a bit simpler (I hope so).

Although I like to think im quite good at thinking things out I am loosing my mind on this one.

I have created a page with a DIVs as the basis of the layout,

a container div encapsulating them all with absolutely nothing but the width and text-align:center set.

a central content container (within the first one) which has a right and a left column for navigation.

My issue now falls when I try to position content within the two columns.

First of all the columns are positioned using float, to position the content I figured I could use position:relative? and then set their position against the contentcontainer div.

Obviously this put them all in a line down the middle left of the screen....

I use position:fixed but I dont like this as the rest of my page is adaptable but it seems backwards for me to code the rest in such a fluid way and then fix the positions of the central content because I cant find a way to position them against the contentcontainer.

What I need is to go, 50px in from the left of the div you are in.

 

Thanks for reading all that, I am hoping I am just doing something stupid or missing an easy trick.

Link to comment
https://forums.phpfreaks.com/topic/164707-div-support-center-content/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.