SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Div/background width problem

    Hi all,

    I have three divs, each the same width. 240px, no padding and a bottom left placed background img.

    I have a nested div in each with the same width and a background img.

    Why is there a 1px difference on each side of the divs when the nested div's background image ends?

    All images used are 240px wide.

    take a lookie

    Thanks for any help!
    No, I REALLY dislike having to use Joomla.

  2. #2
    Design Your Site Team bronze trophy Erik J's Avatar
    Join Date
    May 2007
    Location
    Countryside, Sweden
    Posts
    3,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is the background images, they have white borders, so the blue part is only 238px wide.
    Happy ADD/ADHD with Asperger's

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    If you are talking about this image.

    Then although the image is 240px wide the gray shaded section is only 238px wide and there are 1px white borders down the side of it. This makes the bottom section stick out by 1px because it is 240px of solid gray.

    Is that what you meant?

    You also need to add display:inline to your floats that have margins to cure the ie double margin bug (see faq on floats).

    Edit:


    Erik beat me to the punch

  4. #4
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you both
    No, I REALLY dislike having to use Joomla.


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
  •