Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

CSS3 Links Creation and Usage

By Exforsys | on March 19, 2007 |
CSS3 Tutorial

CSS3  Links Creation and Usage

Links are very vital for any web page to navigate through the site and so is also with CSS3. In CSS3 it is possible to handle links even more powerful and effectively as it is possible to handle various states of links which are link, visited, hover, and active states. Also it is possible to create buttons and boundaries to links in CSS3 by using the features of CSS3 technology which gives the effect of button to links.

As explained above in CSS3 it is possible go handle various states of links which are link, visited, hover, and active states. Before going in depth of how to handle this in CSS3 it is first important to know what each of these states means. Let us see about each of these states in brief.

States of Link:

The states of link are link, visited, hover, and active states.

visited:

This refers to the state of the link after a link has been clicked.

hover:

This refers to the pre-state of the link or in other words the state when a mouse is paced over the link.

link:

The link state refers to the default state of the link.

active:

This refers to the state of the link just after link is being clicked.

The above all four states of link can be handled in CSS3 as needed by the user. But care must be taken by user to use them in proper order namely link followed by visited then hover followed by active that is in short form denoted as LVHA. If the above order is not followed then there would be confusion in the link states which would cause the links from not working. So user must take sufficient care in following the above order while designing links using CSS3.

The general syntax of the link property of CSS3 is as below:

A:link|visited|active|hover

which refers that the link property can take any of the four values link, visited, active or hover. All the four properties can take value as <style>.The style can be given as needed by user just like styling for normal texts. Let us see a small example to understand the above link state usage in CSS3 in brief. Let us define each link state with a separate color that is a unique color for denoting the default state of link and a separate color for denoting the mouse paced over a link, another unique color for representing the link being clicked and visited and then a color to denote the active state of link. This can be done collectively as below:

<style type="text/css">
A: link { text-decoration: none;color: #00e; }
A:visited { text-decoration: none;color: blue; }
A:hover { text-decoration: underline;color: #fff; }
A:active { text-decoration: none;color: red; }
</style>

In the above we see another style property mentioned as text-decoration. In the above example the hover alone has text-decoration value as underline and the rest has text-decoration value as none which depicts that the link becomes underlined only when mouse is placed over the link and remains as not underlined in other states.

It is also possible for creating color on background for the links created. The background color can be set as determined by user for each state of link.

For example:

<style type="text/css">
A: link { background: #CCFF00;text-decoration: none;color: #00e; }
A:visited {background: #ECEC00; text-decoration: none;color: blue; }
A:hover { background: #FFFF00;text-decoration: underline;color: #fff; }
A:active { background: #CCCC00;text-decoration: none;color: red; }
</style>

The above example would create a background color for each state of link as defined above.

Shorter representation:

Now let us see how to present the above format in a shorter format if some properties are common for certain link states.

First let us see an example to understand this concept in detail.

a:link {
color:red;
font-weight:bold;
text-decoration:underline;
}

a: visited {
color:blue;
font-weight: bold;
text-decoration:underline;
}

a: hover {
color:#ff00;
font-weight: bold;
text-decoration:none;
}

a:active{
color:#fff0;
font-weight: bold;
text-decoration:none;
}

In the above representation we find that all the states link, visited, hover and active has the propery

font-weight:bold;

as common and also the property

text-decoration:underline;

holds good for link and visited states and the property

text-decoration:none;

holds good for hover and active states respectively.

So we can combine the above common attributes and could make a shorter representation in CSS3.The above example would take a shorter representation in CSS3 as below:

a{
font-weight:bold;
text-decoration:underline;
}

a:link{
color:red;
}

a: visited {
color:blue;
}

a: hover {
color:#ff00;
text-decoration:none;
}

a:active{
color:#fff0;
text-decoration:none;
}

Use of Creating Links as Buttons:

As explained before it is possible to create buttons and boundaries to links in CSS3 by using the features of CSS3 technology which gives the effect of button to links. One might have a query of what is the use of making links as buttons when a user can normally place a button by using the concept of images as done in earlier versions. The main drawback associated with the earlier approach of placing button by using the concept of images is time factor. That is it takes much time for page to load which in turn decreases the performance. This drawback is removed by the concept of border style being used in links which gives a button effect to links and thereby making the time slice less and there by improving the performance.

« « Ajax Framework
The Potential of Web 2.0 » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 394 Followers
  • Popular
  • Recent
  • CSS3 Selectors

    February 7, 2007 - 0 Comment
  • CSS3 Multi Column Feature

    March 9, 2007 - 0 Comment
  • CSS3 Advantages

    March 12, 2007 - 0 Comment
  • CSS3 Opacity

    March 15, 2007 - 0 Comment
  • CSS3 Wrapping

    March 15, 2007 - 0 Comment
  • CSS3 Introduction

    February 6, 2007 - 0 Comment
  • CSS3 Wrapping

    March 15, 2007 - 0 Comment
  • CSS3 Opacity

    March 15, 2007 - 0 Comment
  • CSS3 Advantages

    March 12, 2007 - 0 Comment
  • CSS3 Multi Column Feature

    March 9, 2007 - 0 Comment
  • CSS3 Selectors

    February 7, 2007 - 0 Comment
  • CSS3 Introduction

    February 6, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • CSS3 Wrapping
  • CSS3 Opacity
  • CSS3 Advantages
  • CSS3 Multi Column Feature
  • CSS3 Selectors

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT