The Slacker's Guide to HTML


[
advanced search]

Home
HTML
Basics
Text Tags and
Text Positioning
Images
Links
Forms
Tables
Frames
Adding Sound
Meta Tags
Horizontal Rules
Comment Tags
Tips & Tricks
HTML Tips
ASCII Codes
RGB Color Chart
Refreshing Pages
Viewing Source
CSS
Basics
Selectors
Properties
Values
Cursor Effects
Positioning Content
Measurement in CSS
Centering with CSS
Custom Form Buttons
CSS For Links
Site Success Center
Site Promotion
Monetize Your Site
Extras
IE Vs. FireFox
Downloads
Myspace Comment




CSS For Links

You can do some cool stuff to your links with style sheets. One of the things people want to do most often is to remove the underline from links. It's easy.

This is the code to remove the underline from all the links:

a {text-decoration: none;}

You are saying that the a tag (such as <a href="http://">) won't be getting an underline. You can specify that only certain links will have a style by using class, ID, and contextual selectors.

You can also declare that your links can have other values for text-decoration. You can have an underline, a line through the links, or a line above them. You can also make the links blink, as you will notice if you use Firefox.

a {text-decoration: none;}
a {text-decoration: underline;}

a {text-decoration: overline;}
a {text-decoration: line-through;}
a {text-decoration: blink;}

Pseudo-Elements

Pseudo-Elements really expand what you can do to the links. With pseudo-elements you can assign specific link styles for links that have been visited, linsk which you have not visited, links which are currently being clicked on, links which the cursor currently hover over.

Here's some sample code with some cool styles.

a:link {color: green; font-size: 125%;}
a:visited {text-decoration: line-through;)
a:active {background-color: gray;}
a:hover {font-variant: small-caps;}

And there you have it. If you had any problems with this stuff, then try the "CSS" section of the menu on the left, at the top.