How can I make a position:absolute; div inside a position: relative; div work in a layout centered by margin: 0 auto;?

As you know the width of the absolute positioned element you can set left:50% margin-left:-225px.

As you know the width of the absolute positioned element you can set left:50% margin-left:-225px. This will set the left edge of the container to the middle of its wrapper and then moves it left by half of it's own width. This will work when you know the width of the container but not that of the wrapper.

This is the only method I know of that will work. It's not terribly pretty but hope it works for you!

Ahh I see, you don't want to use absolute positioning. I believe you should rethink your html. If you are wanting fluid resizing you will need to use percentages.

Alternatively you can move the #topbar out of the #container, set the #container width and use margin:0 auto to center the #container. Then you can use the #content css that Vinay BR provided above – lnrbob Sep 3 '10 at 19:08 I tried to both methods: 1) percentages and 2) moving #topbar out of #container and implementing Vinay BR's #content. The DIV still kept appearing in the wrong place.

I updated the CSS at someone else's suggestion. See edited question. – Leslie Sep 3 '10 at 21:18.

Not sure what exactly you are trying to acheive. Your wrapper and container div's are not needed at all and try using this as you #content class #content { background:url("/images/copy-bg. Png") repeat scroll 0 0 transparent; float:right; padding:10px; text-align:left; width:450px; }.

Thanks, I added your suggestions to the background, but floating right makes the DIV too far from the businessman and too close to the edge. I'd like to keep the DIV in the same place as the image in my comment above. I removed the wrapper div though!

– Leslie Sep 3 '10 at 21:14.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions