Different ways of links

Posted on Updated on

Different ways of links

Links can be styled in different ways.

Styling Links

Links can be styled with any CSS property like we can change the color its font-family,its background,etc.

Example

a {

    color: #FF0000;

}

We can style the links differently depending on the state of links.

The four links states are:

a:link – a normal, unvisited link

a:visited – a link the user has visited

a:hover – a link when user mouse on it

a:active – a link the moment it is clicked

Example

/* unvisited link */

a:link {

color: #FF0000;

}

/* visited link */

a:visited {

color: #00FF00;

}

/* mouse over link */

a:hover {

color: #FF00FF;

}

/* selected link */

a:active {

color: #0000FF;

}

When setting the style for several link states, there are some order rules:

a:hover MUST come after a:link and a:visited

a:active MUST come after a:hover

Common Link Styles

Example we can  changes links color depending on what state it is in.

Ways to style links:

Text Decoration

Text-decoration property is  use to remove underlines from links:

Example

a:link {

    text-decoration: none;

}

a:visited {

    text-decoration: none;

}

a:hover {

    text-decoration: underline;

}

a:active {

    text-decoration: underline;

}

Background Color

It show the background color of the hyper link.

Example

a:link {

    background-color: #B2FF99;

}

a:visited {

    background-color: #FFFF85;

}

a:hover {

    background-color: #FF704D;

}

a:active {

    background-color: #FF704D;

}

For more details and queries please feel free to email, visit or call us. Wishing you the very best for all your future endeavors.

Helpline: 9814666333, 8699444666

Email:info@technocampus.co.in

**************************************************************************************************************

Please fill the FORM and we shall contact you soon.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s