Add Borders to Images

Welcome to Blogging Sueblimely. To keep up with my posts you can subscribe to my RSS feed and follow me on Twitter. Thanks for visiting!

image borders poppypoppy2 thumbred maple thumbamarylis thumb

Inbuilt blog editors make it relatively easy to insert and position images in posts but you can add some additional styling elements and make them more interesting.

The Wordpress insert image screen (Appearance tab) allows you to add inline styling for individual images In Blogger you have to enter the CSS styling manually. If you have a particular style that you are going to use regularly it is simpler to add the a class to your CSS styling. I will explain this more as I go along.

Wordpress add image
Wordpress Insert Image Screen

Firstly I will show you how to just add a simple border to your images and then I will build on this to create some different effects.

Simple Border

image borders poppy

Inline styling

The html for an image with a solid border, 1px in width, color #FF0000:

<img src="http://www.imagesite.com/image.jpg" 
style="border:1px solid  #FF0000;"  />

Blogger - Add your image as usual and in your post html edit tab add all the colored code above after the image location and before the />

Wordpress - In the ‘Insert Image’ window (Appearance tab) - enter the width of border you require to the ‘Border’ box (1 in this example).

This will produce a black border. To alter the color of the border enter border-color: #FF0000; in the Style box. (There is no need to add the code in orange (style=" and ")as this will be added automatically.) You can also add styling by editing in the post html window as in the instructions for Blogger above.

Add Code to Stylesheet

If you are going to use this same formatting regularly add a class to your CSS styling instead of the Inline method above (edit your style.css for Wordpress, Layout/Edit html window in Blogger). Use a descriptive class name and you are more likely to remember it easily:

.border-red {border:1px solid #FF0000;}

When you want to use this border style - insert your image as usual and then add the the class in the html tab. From the example above:

<img src="http://www.imagesite.com/image.jpg"
class="border-red"  />

Border with padding

Follow the instructions as above but add padding to the outside of the image. The color between the image and the border will be the same as your post’s background color.

image borders poppy

Inline styling:

<img src="http://www.imagesite.com/image.jpg" 
style="border:1px solid  #FF0000; padding:6px;"/>

or
Add to Stylesheet
CSS:

.border-padding {border:1px solid #FF0000; padding: 6px;}

HTML:

<img src="http://www.imagesite.com/image.jpg"
class="border-padding"  />

Border, Padding, Colored Background

image borders rose

The same as the prior image except for the addition of a colored background:

Inline styling:

<img src="http://www.imagesite.com/image.jpg" 
style="border:1px solid #5A750C; padding:6px;
background-color:#CCCCCC;" />

or
Add to Stylesheet
CSS:

.border-padback {border:1px solid #5A750C; padding:6px;
background-color:#CCCCCC;}

HTML:

<img src="http://www.imagesite.com/image.jpg"
class="border-padback"  />

Image Consistency

If you have various size images in a post you can standardize the size by adding borders and padding to smaller images to create an overall size matching your larger image. This time I have only included code for inlne styling as the padding will vary from image to image.

image borders red maple

Inline Styling

<img src="http://www.imagesite.com/image.jpg" 
style="border:1px solid #FF0000;
padding:40px 78px 40px 78px;" />

You could get a bit fancier by increasing the width of the border and adding background color:

image borders red maple

Inline Styling

<img src="http://www.imagesite.com/image.jpg" 
style="border:1px solid #FF0000;
padding:35px 70px 35px 70px;
background-color:#F5F5F5;" />

I have not included the ‘alt’ tag in the html coding here for the sake of simplicity. It is always worth adding this for accessibility and search engine reasons. If you need to know more about this please read my post The Alt Attribute and Online Public Relations recent post Demystifying Accessibility Myths: The Alt Tag Attribute

 

Popularity: 12% [?]

Rate this:
2.5
Sueblimely signature

RSS feed | Trackback URI

48 Comments »

Pingback by coComment - Site
2008-06-02 00:40:33

links from Technoratiview blog

 
2008-06-02 06:58:51

Kramer auto Pingback[…] Your page is on StumbleUpon […]

 
Comment by no imageTrish from MyLittleDrummerboys (Who am I?)
2008-06-02 11:39:19

thank you for posting this Sue I have been trawling the internet for simple coding to chnage my blogger borders.
I discovered Piknik last night but I really wanted simple borders. :mrgreen:
Trishs last blog post..Weekly winners

Rate this:
2.9
 
Comment by no imageTrish from MyLittleDrummerboys (Who am I?)
2008-06-02 11:43:32

can I ask your advice about different comment applications for Blogger/Blogspot and what can I do to have the comment window open and click the commenters links.
Presently it opens in the same window with a new tab -but only small window.It is so annoying to open complete new window.

Trishs last blog post..Weekly winners

Rate this:
2.9
Comment by no imageSueblimely (Who am I?)
2008-06-05 06:41:38

The pop up comment windows are a nuisance aren’t they. I always use Firefox so cannot remember if the same problem occurs in IE.

To control javascript popup windows in Firefox Go to: Options/Content/Enable JavaScript - Advanced button. Make sure “Allow scripts to: Move or resize existing windows” is not selected.

Rate this:
2.5
(Comments wont nest below this level)
 
 
Comment by no imageCellobella (Who am I?)
2008-06-02 13:41:22

Sueblimey - great post - very clear.

Rate this:
1.6
 
Comment by no imageTool Belt (Who am I?)
2008-06-03 04:20:45

Great post, another great tutorial that I can use for my website. I love the detail, thanks for the hard work.

Rate this:
2.5
 
Comment by no imageShinade (Who am I?)
2008-06-03 07:00:15

Hi Sue,
Gee whiz please forgive me on being so late. Wow trying to do this in the truck is almost impossible.

And DUH…I just figured out that I can click on the add you purchased and do a drop.

Oh the blond sometines…LOLZ:-)

Shinades last blog post..Pollination

Rate this:
2.9
 
Comment by no imageSasha from cdl driver jobs (Who am I?)
2008-06-03 09:21:16

Great post! And I agree with Tool Belt. This is an excellent tutorial that I can use for my website! I really appreciate individuals like you that take the time and effort to explain things to people like me. :wink:

Rate this:
2.9
 
Comment by no imageJayne (Who am I?)
2008-06-03 11:55:47

When will Blogger get around to these sort of things…or shouldn’t I hold my breath lol ?

Jaynes last blog post..Trivial History June 3

Rate this:
2.5
Comment by no imageSueblimely (Who am I?)
2008-06-05 06:44:35

I think Blogger is good in that you can add to or change your CSS and use any sort of design or layout. Wordpress.com does not allow for this. With self hosted Wordpress you have full control of course.

Rate this:
2.5
(Comments wont nest below this level)
Comment by no imageSheryl A. McCoy (Who am I?)
2008-06-08 19:53:48

Thanks Sue! Talk about “just in time” learning, this is it! I have not been satisfied with the way my pictures look in blogger, and this technique will help tremendously. Your instructions are very clear, and I appreciate the advice about the alt tag. I will read more about that.

Sheryl A. McCoys last blog post..Links for 2008-06-07 [del.icio.us]

Rate this:
1.6
 
Comment by no imageSueblimely (Who am I?)
2008-06-15 05:11:05

Thanks Sheryl
Please let me know if there are any other effects that you would like explained as I am considering a follow up post.

Rate this:
2.5
 
 
 
Comment by no imageFred from Debt Relief Advice (Who am I?)
2008-06-03 12:51:59

This is such a great resource for bloggers. I think every beginner blogger has trouble with images. I have bookmarked this and hope a lot of people find it. I am stumbling it right now. Hopefully that will help.

Rate this:
2.9
Comment by no imageSueblimely (Who am I?)
2008-06-15 05:12:14

Thanks Fred, I appreciate that.

Rate this:
2.5
(Comments wont nest below this level)
 
 
Comment by no imageBarbara Ling (Who am I?)
2008-06-04 06:10:05

Excellent quick tutorial! I just tweeted it.

Enjoy,

Barbara

Barbara Lings last blog post..Define “Blossom” - Day 1 of 7 Days to Making Your Blog Blossom

Rate this:
2.8
Comment by no imageSueblimely (Who am I?)
2008-06-15 05:13:52

Wonderful, thanks Barbara - tweets are excellent for promoting posts.

Rate this:
2.5
(Comments wont nest below this level)
 
 
Comment by no imageAvery from eBooks, AudioBooks, and Cybooks (Who am I?)
2008-06-04 06:12:06

I really like the pictures… they make it very helpful. Thanks for the code!

Rate this:
2.5
 
Comment by no imageandrea (Who am I?)
2008-06-04 14:44:53

Hi mum,

Is the cat better yet?
We are expecting rain tomorrow. Can you believe it? I can’t!

Andrea :mrgreen:

Rate this:
2.5
Comment by no imageSueblimely (Who am I?)
2008-06-05 06:51:30

Rain in Broome - amazing. You will have something more to say when you do your ABC weather report. Just a quick plug for my beautiful clever talented daughter :-) who is living a long long way away :-(

The cat is fine now - no more daily two person struggles to get her to take her meds :-) She is choosing not to go outside recently - it seems it is far too cold for her highness.

Rate this:
2.5
(Comments wont nest below this level)
 
 
Comment by no imageZubli Zainordin (Who am I?)
2008-06-04 20:30:07

Dear Sueblimely, borders to pictures can really be an enhancer. I was just pondering on it yesterday. But, I am not good technically, and I am searching for ways friendly ones so as not to meddle with my blog template HTML. Is there a code like auto-post and pictures get border automatically. Thanks…

Zubli Zainordins last blog post..Friends Close to Heart

Rate this:
2.8
Comment by no imageSueblimely (Who am I?)
2008-06-05 07:23:51

Hi Zubli

If you do not want to edit your template at all you could try writing your posts using blog editor software - Windows Live Writer is good and allows you to add borders and other effects to images. http://get.live.com/writer/overview

Rate this:
2.5
(Comments wont nest below this level)
 
 
Comment by no imageKelley (Who am I?)
2008-06-04 21:14:57

Awesome! Thanks for this babe, I didn’t even realise that I could do it!

Kelleys last blog post..Dude looks like a lady.

Rate this:
2.9
 
Comment by no imageZubli Zainordin (Who am I?)
2008-06-06 00:19:17

Thank you Sueblimely, I shall check it soon. I hope this is simple, and not so complicated as to re-write the HTML of the template. I shall come back to you soon, when I do see the one you suggest, I can follow simply, while eating egg roll on a plate. Thanks.

Zubli Zainordins last blog post..More Mariuca’s Meme

Rate this:
2.8
 
Comment by no imageLarry from 12 Volt Halogen (Who am I?)
2008-06-06 04:24:56

Great tip. I hate when my pictures just look like they are floating in mid air or blend in with the background.

Rate this:
3.0
Comment by no imageSueblimely (Who am I?)
2008-06-15 05:15:51

Adding styling to images can make a blog look more professional - I should do more of it myself :-)

Rate this:
2.5
(Comments wont nest below this level)
 
 
2008-06-06 15:30:17

Kramer auto Pingback[…] lovely Sueblimely always has helpful posts. Her latest, “Adding Border to Images”, presents more useful tips for […]

 
Comment by no imageseo (Who am I?)
2008-06-07 07:47:26

This works a treat for photographer bloggers. I am starting to post more images myself so I guess I will soon implement something similar myself. PS: Thanks for dropping EC on my blog.

seos last blog post..Discovering your next niche

Rate this:
2.9
Comment by no imageSueblimely (Who am I?)
2008-06-15 05:16:52

Great to have a comment from an EC visitor and a reminder that I should do so more often myself.

Rate this:
2.5
(Comments wont nest below this level)
 
 
Comment by no imageRennyBA (Who am I?)
2008-06-07 10:52:31

Well, I was sure I had commented this post? At least I did an SU, course I think it is an excellent presentation of a useful tool - thanks for sharing!

Btw: I was actually visiting to wish you a wonderful end to your week and to tell you: ‘The heat is on in Oslo, Norway:-)
RennyBAs last blog post..The heat is on in Oslo, Norway

Rate this:
2.9
 
Pingback by Blogging Sueblimely
2008-06-08 01:42:27

Kramer auto Pingback[…] Your browser does not support frames. Please click here http://www.sueblimely.com/add-borders-to-images/. […]

 
Comment by no imageGaida (Who am I?)
2008-06-08 12:10:19

Hi Sue,
I love graphics. The photos are beautiful. Did you take them yourself? Thank you for a detailed tutorial on dding borders to images & the additional link to ‘alt tags’ for images.

Gaidas last blog post..Mushroom Tortellini Bake Recipe

Rate this:
2.9
 
2008-06-08 19:40:13

Kramer auto Pingback[…] to Google Latest Content Add Borders to Images - 7 days ago Inbuilt blog editors make it relatively easy to insert and position images in posts […]

 
Comment by no imageJason from Texas golf resorts (Who am I?)
2008-06-09 06:12:23

I think these borders makes the images look a whole lot better. And they look mor professional too.

Jasons last blog post..Texas golf packages

Rate this:
2.5
 
Comment by no imageJourneyer (Who am I?)
2008-06-10 13:26:32

Thanks for the tutorial. I have been wondering how that appearance tab works. Next time I use an image I’ll give a border a try. It improves the look so much.

Journeyers last blog post..Homemade Yoghurt

Rate this:
2.5
 
Comment by no imagePeter McCartney (Who am I?)
2008-06-11 21:41:29

Hi! Your great advise just got used! It gave great depth to the image and topped the whole thing off. Thank you for the other link as well. I have checked it out and it looks pretty good! Take Care

Peter McCartneys last blog post..The Independent Observer

Rate this: