Results 1 to 2 of 2

Thread: Positioning

  1. #1
    Join Date
    Jan 2011
    Location
    England
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Positioning

    When you have positioned and image 'absolutely' on your page, how can you make the next element on the page display underneath this, without using multiple break tags?

    I've been searching google but I cannot find the answer!

    Thanks all.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    You'd need to know how tall the image is. for example,
    HTML Code:
    <style>
    #container{ position: relative; }
    #over{ position: absolute; top: 0; right: 0; }
    #under{ position: absolute; top: 100px; right: 0; }
    </style>
    <div id="container">
       <image id="over" src="somepic.jpg" alt="some pic" height="100" width="300">
       <p id="under">Some paragraph</p>
    </div>
    results in something like:


    keep in mind, however, that absolute positioning changes how the elements are laid out on the page.
    Subsequent paragraphs, images, etc., for example, will not automatically "float" around them; you might end up with over/underlapping content instead.



    This is what it's supposed to do, but might not be what you expect.
    Last edited by traq; 07-17-2011 at 10:47 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •