position:absolute problem

Discussion in 'HTML' started by richard, Nov 20, 2013.

  1. richard

    richard Guest

    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.
    richard, Nov 20, 2013
    #1
    1. Advertising

  2. richard

    JJ Guest

    On Tue, 19 Nov 2013 20:32:05 -0500, richard wrote:
    > 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;
    JJ, Nov 20, 2013
    #2
    1. Advertising

  3. richard

    Doug Miller Guest

    richard <> wrote in news::

    > 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?
    Doug Miller, Nov 20, 2013
    #3
  4. richard

    dorayme Guest

    In article <>,
    richard <> wrote:

    > 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.

    --
    dorayme
    dorayme, Nov 20, 2013
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luqman
    Replies:
    1
    Views:
    645
    Luqman
    Feb 7, 2006
  2. Adam Plocher
    Replies:
    4
    Views:
    25,357
    Adam Plocher
    May 26, 2006
  3. Dimitris Milonas

    Problem with panel with absolute position

    Dimitris Milonas, Oct 21, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    411
    Dimitris Milonas
    Oct 21, 2007
  4. James Byrne
    Replies:
    3
    Views:
    542
    James Byrne
    Sep 14, 2010
  5. nick
    Replies:
    8
    Views:
    177
Loading...

Share This Page