Remove the underline under the links in HTML/CSS

Last update on July 23, 2009 10:29 AM by jak58
Published by jak58
Remove the underline under the links in HTML/CSS




AS you may have noticed, hyperlinks are underlined in HTML (by default) It is possible to remove the underline by using the CSS

Using CSS


<style type="text/css">
a.nounderline:link
{
	text-decoration:none;
}
</style>


Note that the pseudo-class: link allows you to target only the links (<a href="">) and anchors (<a name="">).

Using CSS via a class


If you want this style applies only to certain links, simply by example to define a specific class for the links that are not underlined (eg nounderline class):

<style type="text/css"> 
a.nounderline: link 
( 
Text-decoration: none; 
) 
</ style> 
<style type="text/css">
a.nounderline:link
{
	text-decoration:none;
}
</style>



Then, when writing the link to refer to this class:

<a href="/" class="nounderline">Text of link</a>

Using CSS online


Finally, if you do not want to define stylesheet, you can simply set the style online with the style attribute, as follows:

<a href="/" style="text-decoration:none">Text of link</a>
Best answers for « Remove the underline under the links in HTML/CSS » in :
Remove the border on an image in a link in HTML / CSS Show Remove the border on an image in a link in HTML/CSS HTML You made a clickable image by using the IMG tag within a link and the browser displays a frame or more precisely a border around the image. There are two ways...
Remove Directory Links from Favorites Show Remove Directory Links from favourites Hiding Links folder Permanently delete the Links folder Despite deleting the folder "Links" in favorites, this one is regenerated automatically when you restart the computer. There are two...
[Word]Delete all links Show [Word]Delete all links A common factor when you copy/paste part of a webpage on Word,is that you end up with a document containing a lot of hypertext lin: Here are two solutions to remove these links from a Word...
Popup in CSS without Javascript ShowPopup in CSS without Javascript Here's how to make a popup information in pure CSS, [no Javascript used]. Use :hover so as to use different CSS when moving the cursor. Among the modified CSS attributes, use display:none to...
Optimizing Firefox ShowOptimizing Firefox Remove Directory Links from favourites Hiding Links folder Permanently delete the Links folder Optimization with High Speed Despite deleting the folder "Links" in favorites, this one is regenerated...
Create a beautiful and dynamic website and respectful to standar ShowCreate a beautiful and dynamic website and respectful to standards Links: Code validators Here is a list of links to help you make better use of standards (HTML, CSS, DOM ...) to create sites more beautiful, more dynamic and respectful...
Hyperlinks ShowIntroduction to anchors Hypertext links or hyperlinks (anchors) are HTML elements that, when clicked on, enable readers to visit a new address. Hyperlinked text is underlined by default. Hyperlinks are what connect web pages to one another. They...
CSS - Style sheets ShowFont properties Property Value Description font-family Specific font (Arial, Times, Verdana) Familly (serif, sans-serif, fantasy, monospace, cursive) Defines one or more font names or font families. If multiple fonts are defined,...