WordPress.org

Ready to get started?Download WordPress

Forums

Add border to all images in blog (3 posts)

  1. despacho
    Member
    Posted 8 years ago #

    Hi. I want to add a border to some specific images on my blog(thumbnails). I sometimes post the photo that fits in, but sometimes its a thumbnail. i want a small border around. how can i do that?

  2. marcy
    Member
    Posted 8 years ago #

    If you want all images bordered, insert the following in your stylesheet:

    img
    {
    border: 1px solid #000;
    }

    which will give you a thin solid black line border.

    If you only want certain images to be bordered, you'll have to make the css more specific.

    .post img

    will apply to all imgages in a div whose class is "post."

    img.border

    will apply to any images that are assigned the class "border" -- i.e. in the post you would write

    <img class="border">

    along with the other attributes.

  3. despacho
    Member
    Posted 8 years ago #

    uhh thank you. i modified it a bit. added:
    img {
    margin: 5px;
    padding: 10px;
    }

    big thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic