#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    USA
    Posts
    349
    Rep Power
    16

    Background position in Safari


    I have the following CSS and HTML:

    Code:
    <DIV STYLE="width: 50px; height: 10px; line-height: 10px; background-color: #D0D0D0;">
     <DIV STYLE="width: 100%; height: 100%; background: url(/imgs/blog/stars/smallblock.png) -15px 0px no-repeat;">
     </DIV>
    </DIV>
    In all browsers except Safari the outer div is covered by the inner div except for the very last 15px, hence the -15px to offset it. In Safari the inner div covers all of the outer div. Any way to fix this?
    Chaos Coding
    Did I help you out? Show some love with the button
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,126
    Rep Power
    4309
    Which version(s) of Safari are you testing in? Are you sure nothing else is affecting this?
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    USA
    Posts
    349
    Rep Power
    16
    I'm using Safari 2.0.4 on an x86 Mac Mini. I can't imagine what else would be effecting it.
    Chaos Coding
    Did I help you out? Show some love with the button
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    USA
    Posts
    349
    Rep Power
    16
    After playing around with the code for a few more minutes I'm noticing that by resizing my background image to a size of 49px instead of the full 50px the background position starts to work again; however, I absolutely need the 50px, not 49. Is this just some weird rendering quirk in Safari?
    Chaos Coding
    Did I help you out? Show some love with the button
  8. #5
  9. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,126
    Rep Power
    4309
    Does a 51px background image work?
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo