Forums

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

Home Forums CSS add background image to h2 with padding? quick fix, i hope :)

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #40502
    houseofgrays
    Member

    [Here’s the page:](http://www.sacredjourney.com/testing/ “Testing Page”) http://www.sacredjourney.com/testing/

    I’ve used this code but I can’t get the background image scooted over. Thanks so much in advance!

    .post h2 a, .tsj_guestbookentries h2 a {
    font-family: ‘Conv_Gothic’, Arial, sans-serif;
    background: url(http://www.sacredjourney.com/wp-content/uploads/2012/10/tsj-bullet.png) left center no-repeat;
    color: #415441;
    font-size: 16px;
    text-decoration: none;
    padding: 0 15px 0 30px;
    line-height: 0px;
    }

    #112848
    Senff
    Participant

    What are you trying to do exactly? “Scooted over” where?

    #112849
    houseofgrays
    Member

    Sorry :)

    I’d like it to have a padding-left: 15px like everything else. Right now it’s hanging off the sidebar container and I’d like to left align it with the text above and below.

    Thanks!!

    #112850

    Change:

    background: url(http://www.sacredjourney.com/wp-content/uploads/2012/10/tsj-bullet.png) left center no-repeat;

    To:

    background: url(http://www.sacredjourney.com/wp-content/uploads/2012/10/tsj-bullet.png) 15px center no-repeat;

    I think that’s what you are after?

    Basically, we are telling the background image to sit 15px from the left of the container, instead of hard up against it.

    Also, for future reference, it is often easier to give the parent element padding instead of each child element. That would have also avoided this issue.

    #112851
    houseofgrays
    Member

    like a charm! mmmmwwwah!

    #112852

    Awesome :)

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.