www.webdeveloper.com
Results 1 to 3 of 3

Thread: do I need absolute or relative positioning?

  1. #1
    Join Date
    Jul 2009
    Posts
    77

    Question do I need absolute or relative positioning?

    I'm trying to make an image overlap another with a bit of a negative margin. To see what I mean click here: http://www.flickr.com/photos/52660004@N02/4857716644/. Here is the code I have so far, but it's obviously not right because there is a huge gap...

    Code:
    <div class="entry">
    <img src="/images/Logo-Swirly2.png" style="position:relative; left: -160px;">
    <?php the_content(); ?> //this just gets the content (including images) from the database
    </div>
    I've tried absolute positioning but that just made it relative to the entire browser window, and I've tried using floats, but the content still tried to wrap around the image--I don't want the content to even know that the image is there...

  2. #2
    Join Date
    Jul 2010
    Location
    Netherlands; Groningen
    Posts
    29
    Hello, position absolute is relative to the last element that used a position relative or position absolute attribute. In other words, to make your image move to the desired position you will have to give an element a "position: relative" attribute. I can see from the screen-shot that you use a title. I'd suggest you use that as a reference point and give the element containing the title the "position: relative" attribute. I hope this solves your problem.

  3. #3
    Join Date
    Aug 2007
    Posts
    3,767
    If you post the HTML and CSS it will be must easier to help you.
    Great wit and madness are near allied, and fine a line their bounds divide.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles