WordPress.org

Ready to get started?Download WordPress

Forums

border around image how to? (9 posts)

  1. BartAfterDark
    Member
    Posted 8 years ago #

    Hello.
    How can I add a border like they have here
    http://www.zipperfish.net/blog/blogger.html
    Around the images in the post

    - lars

  2. KaushalSheth
    Member
    Posted 8 years ago #

    add css tag like for eg

    img {margin: 10px;padding: 10px; border: 1px solid #2F700F; }

    i added for my blue horizon theme for images.

  3. Sphyr
    Member
    Posted 8 years ago #

  4. BartAfterDark
    Member
    Posted 8 years ago #

    great :D

    What file to I have to edit. So all images in a post uses the .thinborderfloat class?

  5. hallsey
    Member
    Posted 8 years ago #

    The file is your theme's style.css file, under wp-content/themes/[your_theme].

    The code to add there is:

    .thinborderfloat {
    float:left;
    border:solid 1px silver;
    padding:5px;
    margin-right:10px;
    }

    Later, in your posts, when adding an image, you'd use:

    <img class='thinborderfloat' src='... />

  6. BartAfterDark
    Member
    Posted 8 years ago #

    hallsey I allready did it like that.
    But was just wondering if i could put the class in one of the files. So it allways would use it when there are images in the post

  7. hallsey
    Member
    Posted 8 years ago #

    Yes, in that case, replace .thinborderfloat { with img { (no period). Now you don't have to put class='... in your <img tags; all images will automatically display formatted with that class.

  8. hallsey
    Member
    Posted 8 years ago #

    Oh, btw, the class stays in your style.css file.

  9. BartAfterDark
    Member
    Posted 8 years ago #

    If i add it to the img tag all my images gets the border (logo, top, banners, etc.) :/
    But thanks anyway. Gonna use class="thinborderfloat" instead :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.