Alignment with relative and absolute positioning?

If you're able to change the span tag to a div.

Then this piece of CSS should work. #rel { position: absolute; top: 10px; left: 20px; width: 400px; height: 300px; border: 1px solid red; text-align: center; } #abs { width: 300px; height: 200px; border: 1px solid blue; margin: auto; margin-top: 50px; } I think it's better to use more automation for the enclosed box as less changes would be needed should you change the size of the container box.

You could add left:50px to #abs if that's all you want... #abs { position: absolute; bottom: 15px; width: 300px; height: 200px; border: 1px solid blue; left:50px; }.

I mean that the dimensions of the boxes aren't known. I want to align regardless of boxes dimensions. – Misha Moroshko May 20 '10 at 15:32.

If you are going to define dimensions like that (200px x 300px and 300px x 400px), here's how it can be centered: #rel { position: relative; top: 10px; left: 20px; width: 400px; height: 300px; border: 1px solid red; text-align: center; } #abs { position: absolute; width: 300px; height: 200px; border: 1px solid blue; margin: 49px 0 0 49px; }.

The dimensions are not constant. I edited the question. – Misha Moroshko May 20 '10 at 15:32 Are you trying to center the entire box?

Or just the left/right centering? – Brant May 20 '10 at 15:36.

This should work #abs { position: absolute; left: auto; right: auto; bottom: 15px; width: 300px; height: 200px; border: 1px solid blue; }.

The left/right auto trick (like centering a div with margin) doesn't work here. – Brant May 20 '10 at 15:26.

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