Article Directory :: Internet Marketing/Online Business Articles

Using Hyperlinks and CSS in Your Website

By Larry Lang

Subscribe to Larry Lang's RSS feed using any feed reader!

Republish: EasyPublish
Published: 02Aug2007
Word count: 556
Viewed: 261 time(s)
Bookmark this article using any bookmark manager!
Get Free Content For Your Site

A class is the blueprint from which individual objects are created. In Java, a class is used to show a set of like items.

Here is an example of a hyper link going to a site using a class: http://www.mysite.com" title="Home Page">Elite Web Strategies a:link { color: #000000; background-color: #ffffff } a:visited { color: #0000ff; background-color: #ffffff } a:hover { color: #0000ff; background-color: #ffffff } a:active { color: #ff0000; background-color: #ffffff } So what is each part used for?

* "a:link" will specify what the hyperlink looks like on the page. * "a:visited" will specify what the hyperlink looks like once it has been visited (clicked on). * "a:hover" shows what the hyperlink will look like when hovered and * "a:active" specifies what the active link will look like.

In the above example you'll also notice both color and background colors are designated. Color indicates the actual color of the font, followed by the hex code for the color you want. The background color is the color behind the text itself, followed by the hex code for that color.

It's important that these hyperlinks are written in the proper order which is why they are put in a class such as above.

CSS Link Specificity - How to Put Your Links in Order

There is an acronym to help you remember the proper order to place your links in. You might think of something to help you remember it easier but some people simply remember LVHA. This simple acronym, LVHA will help you get your hyperlinks in the right order every time.

LVHA stands for:

1. a:link 2. a:visited 3. a:hover 4. a:active

LVHA is the order you should designate your link rules in the CSS so they work together. The way that it is designed to work in CSS, each selector has specificity. So just like anything else in the cascade, if there are two selectors that are both applied to one element, the one with the higher specificity is applied. If you put them in the wrong order, you could end up with a page that isn't showing your style rules as you intended them.

The only two that you can change the order on are the a:link and a:visited (primarily because a link is only either or, never both). You can change many things with links, but always keep in mind that specificity so that they show properly on your page.

Here is an example of a potential problem and how it is corrected.

Problem Order

a:link { color: #000000; background-color: #ffffff } a:visited { color: #0000ff; background-color: #ffffff } a:active { color: #ff0000; background-color: #ffffff } a:hover { color: #0000ff; background-color: #ffffff }

If you use the above CSS, all of it will work except the active rules. Those will not show. This is because the active has to come after the hover to follow the LVHA format. If the active is placed before the hover, it breaks that part of the class.

Simply swapping the places of the active and hover will fix the order of the cascade and allow it to all work.

Correct Order

a:link { color: #000000; background-color: #ffffff } a:visited { color: #0000ff; background-color: #ffffff } a:hover { color: #0000ff; background-color: #ffffff } a:active { color: #ff0000; background-color: #ffffff }

Following the LVHA rules will help you keep your CSS hyperlinks in the right order to comply with W3C.

– Resource Box – This article may be distributed freely on your website, as long as this entire article, including working links and this resource box are unchanged. For more tools, tips, and tricks of the trade, go to: http://www.elitewebstrategies.com - Empowering You to Empower Your Business. Copyright 2007 Larry Lang All Rights Reserved. Lang Enterprises Inc.

Bookmark this article using any bookmark manager! Subscribe to Larry Lang's RSS feed using any feed reader!

EasyPublish™ this article - publishers click here

More articles by Larry Lang

Free Report!
Ten Essential Secrets Of Article Marketing ... Grab Your Free
Copy
Now:




We respect your privacy.


Need Content?
Regular Top Quality Content for your Blog, Ezine or Website ...
Delivered Direct,
For Free!

Click For Details



Arts & Entertainment
Automotive
Business - General
Computers & Technology
Finance & Investment
Food & Drink
Health & Fitness
Home & Family
Internet Marketing/Online Business
Legal
Pets & Animals
Politics & Government
Reference & Education
Religion & Faith
Self-Improvement/Motivation
Social
Sports & Recreation
Travel & Leisure
Writing & Speaking

More internet marketing articles:

  • Data Entry Work Is A Great Way To Make Money Online From Home (Chris Grayson)
    The secret to being able to make money online from home with your data entry business is doing good quality work, building your reputation and constantly promoting yourself.

  • 6 Unique Home Business Ideas (Donald Jones)
    There are so many different options of ways to make money out of your home. 6 unique home business ideas that could be the business choice for you.

  • Make Money On The Internet Without Your Own Website (Paul Jesse)
    One thing that is interesting for people trying to make money on the Internet is they can do it without a website of their own. In this article we will take a look at 4 ways you can use the Internet to make money and you do not even need your own website.

  • An Entrepreneurial Mindset, Is It Hard To Develop? (Elmar Sandyck)
    The ways of the modern world has made work a definite need in order to survive and flourish in the society where we find ourselves in. The number of career opportunities can give us enough career choices.

  • Learn To Sponsor More Reps And Like An Olympian Your Business Will Be A Gold Medal Winner (Corey Ellis)
    Building a successful online business takes committment like that of an Olympian champion. No greatness is achieved over nite. Learn how to be consistent, committed, and disciplined in your online business.

  • So You Want Your Own Home Internet Marketing Business! (David Sharp)
    Like all other careers, it is essential to make sure that effort is applied. No internet income from home will be earned without applying the necessary effort. If one expects to become successful, a home internet marketing business should be treated like a real job.

  • Make Money On The Side: Become A Freelance Writer (C Mark Babcock)
    In this article we want to talk about how you could become a freelance writer and make money on the side doing it. There are many benefits to using the Internet to write for other Internet marketers!

  • Why Should You Build a List (Bill Wynne)
    Every business owner should know the value of a subscriber list. A list of subscribers will allow you to create a residual income that is more consistent than a sale here and there. This article will address why you should build a list.

  • Why You Should Start a Home Business On The Internet (Pasi Kaarakainen)
    A home business on the internet can allow you to quit your day job and earn all of your income from the privacy of your own home. If you have a computer and know how to navigate the internet, you essentially have everything you need to get started and create your own success online.

We Automatically Distribute Articles
To Thousands Of Publishers And Web Sites:

Submit Article
All content is viewed and used by you at your own risk and we do not warrant the accuracy or reliability of any of the information. The views expressed are those of the individual contributing authors and not necessarily those of this web site, or its owner, Takanomi Limited.
 
Copyright © 2010 Takanomi Ltd. Company no. 5629683. All rights reserved. | Privacy | Legal | Contact Information