SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2010
    Location
    India
    Posts
    52
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Positioning an image

    Hi,

    I want some help, please.

    In this page - the egg image is going a bit upwards while it comes absolutely correct in this one

    This is because some fields like "sex", "subject", "department" etc. in the previous link are missing.

    Those fields are optional so they will appear in some pages and not appear in some pages. What should I do so that the egg position is like in the second link in all cases?

    Any help is appreciated.
    Last edited by HAWK; Aug 18, 2011 at 01:04.

  2. #2
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The eggimage div is positioned by means of a negative top margin, and as its original position depends upon the preceding content, which is variable, it's not a reliable method.

    An alternative would be to absolutely position the div within it's parent div.

    The parent has three classes applied: jr_pgContainer jr_itemDetail hReview-aggregate, so firstly apply position:relative to one of these so that child elements may be absolutely positioned in relation to its boundaries. For example:
    Code CSS:
    .jr_itemDetail {
    	position:relative;
    	}
    Then remove the float, margin-top and margin-right from .eggimage, and apply position:absolute; top:82px; and right:50px;
    Code CSS:
    .eggImage {
    	position: absolute;
    	top: 82px;
    	right: 50px;
    	padding: 0 1em;
    }

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2010
    Location
    India
    Posts
    52
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Victorinox!! It worked like a charm!! :-)

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2010
    Location
    India
    Posts
    52
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    How do I delete this thread? I don't want this thread in Google search results when somebody searches for my website. And that is exactly what is happening.

    I used bit.ly links so that links will not appear, but this forum puts the title of the website and not links.

    Moderator, can you please remove this thread? Or change the site name so that this thread doesn't appear in Google search results for my site?


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
  •