The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS background position?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #39067

    I have a span tag with the address to a fake company in it. I have a background image set up on the span tag to sit centered and to the left. So it is in the beginning of the span tag. Then I used text-indent so that the address will start a few pixels after the background image. My problem is that I need the image to set to the left and centered, but I need it to sit about 10 pixels or so more to the right so that it will line up directly under an image above it. I am not sure how to move the background to the right and still make it go left. Any padding changes makes the text missalign with the text above it. You can see what I mean in the photo below. I need the bubble to be centered under the phone without moving the text to the right

    this is what I have now

    background: url(images/marker.png) no-repeat center left;


    Instead of putting left, try:

    background: url(images/marker.png) no-repeat center 5px;

    And just play with the offset.


    this probably isn’t really the answer you’re looking for, but this could be a solution: can you just take that bubble image in photoshop and make it the same size as the telephone and centered? that way you can use the same css rules for both?


    Ah alright, I just had it backwards. You probably already figured it out, but here why:

    background: url(url) repeat x-offset y-offset;
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.