position:absolute problem

R

richard

I have a 3 column header.
the left and right columns have images.
the left column has text positioned absolutely over the image.
When I put text in the center column, it winds up in the left column
positioned according to the css for the left column.

How do I get it so the text stays in the center column as wanted?
I tried position:absolute with the center column but that didn't work.
 
J

JJ

I have a 3 column header.
the left and right columns have images.
the left column has text positioned absolutely over the image.
When I put text in the center column, it winds up in the left column
positioned according to the css for the left column.

How do I get it so the text stays in the center column as wanted?
I tried position:absolute with the center column but that didn't work.

One trick is to put the text DIV/SPAN before the IMG, then make the DIV/SPAN
style:

position:absolute; z-index:9;

You might need to need increase the "z-index" if the text is still beneath
the IMG.

To adjust the text position, use "margin" instead of "left" and "top". The
margin position will be relative to the current position. e.g.:

margin: 20px 0 0 20px;
 
D

Doug Miller

richard said:
I have a 3 column header.
the left and right columns have images.
the left column has text positioned absolutely over the image.
When I put text in the center column, it winds up in the left column
positioned according to the css for the left column.

How do I get it so the text stays in the center column as wanted?
I tried position:absolute with the center column but that didn't work.

URL of the page with the problem?
 
D

dorayme

richard said:
When I put text in the center column, it winds up in the left column
positioned according to the css for the left column.

Remember that absolute positioning takes elements out of the flow, it
is often as if the rest of the HTML is blind to it, so you need to
make sure the left margin for the centre column is sufficient to clear
the width you have for the abs pos element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top