Quackit Logo

Got a MySpace Page?

Get "www.yourname.com" for your MySpace page. Learn how >>.

HTML Image Borders

Print Version

To change the appearance of image borders, you need to use CSS (Cascading Style Sheets). You can include CSS in your images using the HTML style attribute. You can use the HTML code on this page to determine image borders within your HTML document.

Below are some examples of what you can do with HTML image borders using CSS.

Solid Border

<img style="border:1px solid black;"
	src="/pix/milford_sound/milford_sound_t.jpg"
	width="225"
	height="151"
	alt="Milford Sound in New Zealand" /><br />

This code results in:

Milford Sound in New Zealand

Dotted Border

<img style="border:2px dotted #545565;"
	src="/pix/milford_sound/milford_sound_t.jpg"
	width="225"
	height="151"
	alt="Milford Sound in New Zealand" /><br />

This code results in:

Milford Sound in New Zealand

Grooved Border

<img style="border:6px groove #545565;"
	src="/pix/milford_sound/milford_sound_t.jpg"
	width="225"
	height="151"
	alt="Milford Sound in New Zealand" /><br />

This code results in:

Milford Sound in New Zealand

Double Border

<img style="border:6px double #545565;"
	src="/pix/milford_sound/milford_sound_t.jpg"
	width="225"
	height="151"
	alt="Milford Sound in New Zealand" /><br />

This code results in:

Milford Sound in New Zealand

Thick Solid Border

<img style="border:60px solid #545565;"
	src="/pix/milford_sound/milford_sound_t.jpg"
	width="225"
	height="151"
	alt="Milford Sound in New Zealand" /><br />

This code results in:

Milford Sound in New Zealand

The above code uses the CSS border property which is shorthand for the various border properties (such as border-style, border-color etc. For more info, check out the various border properties on the CSS Properties list.

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!