Web Analytics Made Easy -
StatCounter Absolute positioning - CodingForum

Announcement

Collapse
No announcement yet.

Absolute positioning

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Absolute positioning

    Hi all.

    I have used style=position:absolute to place an image precisely where I want to on the screen, thanks to some help obtained from this forum last week.

    Is it possible to do the same with straight text?

    I have placed a table on a page and immediately after the </table> tag I just put some text "This is a text placement test".

    I've tried to use variations of <style=...> to position the text next to the first table element at the top of the document, but nothing seems to work. Does absolute positioning only work for objects?

    The code is:

    <html>
    <body>
    <table>
    <tr><td>Item 1</td></tr>
    <tr><td>Item 2</td></tr>
    etc
    <tr></tr>Item x</td></tr>
    </table>
    This is a text placement test.
    </body>
    </html>

    which produces:

    Item 1
    Item 2
    etc
    Item x
    This is a text placement test.

    whereas I want:

    Item 1 This is a text placement test
    Item 2
    etc
    Item x

    Is this possible, and if so, how?

    Thanks in advance.

    Russell.

  • #2
    you have to place the text within a div tag.

    Like so: <div style="position:absolute;top:0;left:10;">this is a test Text</div>
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

    Comment

    Working...
    X