Improve Site Performance Increase Site Traffic Monitor Site Uptime Webmaster Resources NetMechanic Home Looking For Help? Partner Programs Privacy Policy Contact Us Press Room
NetMechanic Home LOGIN | HELP | ABOUT US | PRODUCTS | SITE MAP
NetMechanic Menu
Over 52 Million Web Pages Tested!     
 

Search for:


Your Email:

I would like to receive my newsletter in:
HTML format
Text format



Volume 8 (2005)
   September
   June
   April
   March
   January

Volume 7 (2004)
   November
   September
   July
   June
   May
   April
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 6 (2003)
   December
   November (Part 2)
   November
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 5 (2002)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 4 (2001)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 3 (2000)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June
   May
   April
   March
   February
   January

Volume 2 (1999)
   December
   November
   October
   September
   July
   June
   May
   April
   March
   February
   January

Volume 1 (1998)
   December
   November
   October
   September

 

HTML Tip:
Spaces Around HREF Tags

by Larisa Thomason,
Senior Web Analyst,
NetMechanic, Inc.

  
December 2000
Vol. 3, No. 17
 • Design Tip
 • HTML Tip
 • Beginner Tip
  

Have you ever noticed mysterious underline characters (underbars) scattered around on a Web page like freckles? You usually notice them adjacent to a linked image, but they've also been sighted next to text links as well. In this article, we'll track down the source of the mystery underbars and show you how to keep them off your pages.

Spaces Around Image Links

The answer is maddeningly simple but it can be almost impossible to find! The extra underline characters appear next to links when you accidentally insert extra spaces or carriage returns inside your HREF tags.

The problem occurs in both Netscape and Explorer. WebTV isn't affected because it displays links differently than the other browsers.

Look at the example below. For the sake of clarity, we left out the ALT and image size attributes:
Check your page for errors.
<a href="http://www.netmechanic.com/"> <img 
  src="html_help_bulb_no17.gif">
</a>  NetMechanic can help!

Note the space between the opening HREF tag and the IMG tag and the carriage return between the end of the IMG tag and the closing anchor tag. Browsers display the code like this:

Check your page for errors. HTML Help from NetMechanic NetMechanic can help!

The browser displays those small bars on either side of the picture because it interprets the HTML code to mean that the spaces between the IMG and HREF tags are part of the hyperlink.

Spaces Around Text Links

You can also create the same effect with text links.

Use<a href="http://www.netmechanic.com"> NetMechanic </a>tools 
   to find errors on your site!

That code gives you the following link:

   Use NetMechanic tools to find errors on your site!   

In this case, the spaces between words are placed inside the HREF tag instead of outside. Again, the browser assumes that the spaces are an intentional extension of your link and highlights the space in the same color as the link text.

The right underbar display problem is the most common because the left underbar disappears if you place a space between the outside text and the beginning HREF tag. The right underbar stays as long as there's a space before the closing anchor tag.

Use <a href="http://www.netmechanic.com"> NetMechanic </a> 
   tools to find errors on your site!
   Use NetMechanic tools to find errors on your site!   

HTML Toolbox Finds Other Problems

The mystery underbars often pop up on Web pages when you design the page, add the copy, the go back later to insert your hyperlinks. Fortunately, it's easy to see in a browser and simple to correct in your code.

Use NetMechanic's HTML Toolbox to find and repair other errors that are more difficult to handle. It will alert you to spelling errors, cross-browser compatibility problems, HTML errors, and more.



Rate This Tip:
Not Useful Useful Very Useful   
 
NetMechanic Tools
HTML Toolbox
Browser Photo
Server Check
Search Engine Starter
Search Engine Tools
GIFBot
Newsletter
HTML Tutorial and Tips
Search Engine Tutorial
Accessibility Information
Browser Problem Tutorial

Company Info
Products
About Us
Contact
Advertise
Link To Us
Jobs
Privacy Policy
Partner Programs
Press Room
RSS Feed
Support
 



Powered by Overture!

 
     
 
   
 
     


Keynote Home
Copyright © 1996-2007,
Keynote NetMechanic
All rights reserved.