954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Getting rid off the border round link images

Hi everyone

I can't remember how to get rid of the border on images when i use them as links, and also can someone remind me the code for changing text links, sumthin link

But i can't remember it very well.

cuddlers89
Junior Poster in Training
57 posts since Mar 2004
Reputation Points: 11
Solved Threads: 0
 

To get rid of borders around link images add border="0" to the image.


The preferred method for changing link colours is using stylesheets. You'd use something like

a:link{text-decoration:none;color:#3366cc;font-weight:bold;}
a:visited{text-decoration:none;color:#6699ff;font-weight:bold;}
a:active{text-decoration:none;color:#3366cc;font-weight:bold;background-color:#cccc00;}
a:hover{text-decoration:none;color:#0000cc;font-weight:bold;background-color:#cccc00;}

You can use link, alink, and vlink on the body tag and it will still work in current browsers but the body tag option doesn't allow you to set the hover colour.

felgall
Junior Poster in Training
50 posts since Aug 2004
Reputation Points: 13
Solved Threads: 1
 

As felgall said, the preferred method of doing colours is via CSS (Cascading Style Sheets). You can also take the border off images via CSS also. Here is an example. My comments are marked out by /* & */.

a:link, a:visited { /* this defines unclicked, and clicked link properties */
	text-decoration: none; /* you can set this to underline, or none. */
	color: #000000; /* sets color, hexadecimal, right now it is black */
	font-weight: bold; /* sets your font to bold. bold or none are most common here */
}
a:hover, a:active { /* defines mouseover, and clicked/processing links */
	text-decoration: underline; /* set this to the opposite of what rested state links are for it to underline on mouseover */
	color: #000000;
	font-weight: bold;
}
img { /* defines the css for the <img> tag */
	border: 0px; /* set border width to 0 pixels */
}
rixius
Posting Whiz in Training
233 posts since Nov 2003
Reputation Points: 12
Solved Threads: 3
 

Ok thanks, i sort of understand but have never used css before, the image is the only one on the page and there isn't very many links, so if css does what i think it does, i don't think its nessasary here.

Just to be clear, i don't want to get rid of the border around an image, i have allready done that, its when i set the image to a link that the border comes up

You probley have answerd my question but i just don't understand css.

cuddlers89
Junior Poster in Training
57 posts since Mar 2004
Reputation Points: 11
Solved Threads: 0
 

hey no coding is necessary, you can do this setting using the Microsoft Frontpage, select the image >> right click >> properties >> in the border size =2, enter the value as "0". thats it ! now the image thats linked wud not have any border lines !!

Vinay
Light Poster
29 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

Its as easy as

<img src="http://www.whatever.com/something.jpg" border="0">


But you can always do it the complicated way ;D

Cup of Squirrel
Junior Poster
133 posts since Oct 2004
Reputation Points: 11
Solved Threads: 1
 

Thanks man, smooth and simple. Jut what I needed : )


[QUOTE=Cup of Squirrel;60051]Its as easy as

<img src="http://www.whatever.com/something.jpg" border="0">


But you can always do it the complicated way ;D[/QUOTE

AmandaLee
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 0
 
a img{
  border:none; /* or use border:0; - does the same thing here */
}


The image element is enclosed within a link tag, so ensure that this is represented in the css, otherwise all image styles will look like link images. However, if you don't want link images to look different from normal images (all images look the same regardless of whether they're links or not, just do this:

img{
  border:none; /* or use border:0; - does the same thing here */
}


I'd advise you to stay clear or html attributes like border="0". HTML is for logic, CSS is for styling. Try not to mix them.

See http://www.w3schools.com/tags/tag_img.asp

It will tell you that border attributes are deprecated.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,800 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You