Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
How do I change the color of the border around my image?
Old 01-21-2011, 02:30 AM How do I change the color of the border around my image?
Novice Talker

Posts: 6
Location: Denmark
Trades: 0
I want to turn an image into a link by wrapping it in an <a> element, a blue border appears around the image. I am often asked how to remove this border?
__________________

Please login or register to view this content. Registration is FREE
Miltonbean is offline
Reply With Quote
View Public Profile Visit Miltonbean's homepage!
 
 
Register now for full access!
Old 01-21-2011, 03:42 AM Re: How do I change the color of the border around my image?
Skilled Talker

Posts: 60
Name: Dmitry
Trades: 0
Something like this
<a href="http://yourlink.com"><img src="http://yoursite.com/img.jpg" border="0" /></a>
__________________
Sincerely, Dmitry

Please login or register to view this content. Registration is FREE
ElmanF is offline
Reply With Quote
View Public Profile Visit ElmanF's homepage!
 
Old 01-21-2011, 03:55 AM Re: How do I change the color of the border around my image?
Skilled Talker

Posts: 50
Name: One Word
Trades: 0
turning an image into a link to another page is very simple, and the following HTML does the trick:
<a href="http://www.boutell.com/">
<img src="/boutellcomlogo.png">
</a>

However, you will note that a blue border appears around the image. This border is meant to inform users that the image is a link. Of course, there is something to be said for knowing what is a link, and what isn't.

Today, though, most web designers make it perfectly obvious through the design of their banners and navigation buttons that they are links to be clicked on. So how do we turn off the blue border?

The Right Way: XHTML Compliance And CSS

Modern browsers support CSS and the XHTML standard, and many designers are required to create pages that comply with XHTML. For those who need to create XHTML-compliant pages, CSS is the only way to go. The only drawback is that Netscape 4.x will still display a blue border. Of course, well below 1% of users are still using Netscape 4.x, and that number shrinks every day.
Here's a quick-and-dirty example with inline styles:


<a href="http://www.boutell.com/">
<img src="/boutellcomlogo.png" style="border-style: none"/>
</a>

An even cleaner solution, if you never want the blue border, is to say so in a style sheet:


img
{ border-style: none;
}

And then reference that style sheet in the head element of your page:


<link href="/mystylesheet.css" rel="stylesheet" type="text/css"/>

This method will automatically remove the blue border from all linked images in any page that uses that .css file.
ONE WORLD is offline
Reply With Quote
View Public Profile
 
Old 01-22-2011, 03:24 PM Re: How do I change the color of the border around my image?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Actually, to get rid of the blue border caused by putting it inside a link you need this css:


a img{border: none;}
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do I change the color of the border around my image?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.90633 seconds with 12 queries