How to Remove Borders From HTML Hyperlink Images
In HTML, images used as hyperlinks show a border by default. Having a border can clash with the look and feel of a website and make it look unprofessional. In HTML 4, the preferred method of controlling the look and feel of images is with cascading style sheets (CSS). Style information is added to the IMG tag to control the border. A simple HTML file demonstrates its use.
Instructions
-
-
1
Click the Windows "Start" icon. Select "All Programs" followed by "Accessories" and "Notepad."
-
2
Type the following HTML code:
<a href="http://example.com"><img src="http://bit.ly/lA5ldY" style="border:none;"></a>
-
-
3
Click the "File" menu followed by "Save As..." Change the "Save as type" drop-down box to "All Files." Enter a file name, such as "noborders.html," in the "File name:" field. Make sure to use the ".html" file extension.
-
4
Open the "Start" menu, and then click "My Documents." Double-click the "noborders.html" file to open the file in your Web browser.
-
1
Tips & Warnings
Using the "border" attribute (such as "<img src="http://bit.ly/lA5ldY" border="0">") was officially depreciated by the World Wide Web Consortium (W3C) in favor of CSS. However, it still works in all of the modern browsers.