Occasionally, though, someone likes the border and just wants to change the color. You can do this easily using a style attribute:
<a href="http://www.boutell.com/">
<img src="/boutellcomlogo.png" style="border-color: red">
</a>
An even cleaner solution, if you always want a red border for linked images, is to say so in a style sheet:
img
{
border-color: red;
}
And reference that style sheet in the head element of your page:
<link href="/mystylesheet.css" rel="stylesheet" type="text/css">
This method will automatically display a red border around all images which are links.
Don't forget to make it very clear through your design choices that the image is still meant to be clicked on.
Legal Note: yes, you may use sample HTML, Javascript, PHP and other code presented above in your own projects. You may not reproduce large portions of the text of the article without our express permission.
Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!
Follow us on Twitter | Contact Us
Copyright 1994-2012 Boutell.Com, Inc. All Rights Reserved.
