WordPress.org

Ready to get started?Download WordPress

Forums

How to edit the css for img. but not mess up the header?? (2 posts)

  1. cyrillsneer
    Member
    Posted 6 years ago #

    So I changed themes, that allow us much more width in the index.php, as such we can now write down the side of images.

    I then discovered that the images don't automatically pad, considering 99% of the writers are very non-technical i was trying to work out a way to have it add 5px padding on every image uploaded, while still lining to the left or right extreme of the index.php.

    The closest I got was adding this to the stylesheet.

    img {
    margin: 5px;
    padding: 10px;
    border: solid black 1px
    }

    As i found out this now affects the header image, which screws up the site.

    Any chance some could show me how to set it up, so that, if someone Left, Center or Right aligns an image, that it adds padding of Xpx?

    I would be very grateful, hell i'll donate $5 to the charity you name, how does that sound?

    Thanks,
    Will

  2. shadow
    Member
    Posted 6 years ago #

    Not sure which theme you are using but usually you can make the image css post specific. Have a look what the div class is called for your posts and then add that to your css above.

    For instance, if your class for posts is 'post', just do the following:

    .post img {
    margin: 5px;
    padding: 10px;
    border: solid black 1px
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags