- CSS - Scrollbars
- CSS - Dimension
- CSS - Outlines
- CSS - Cursors
- CSS - Padding
- CSS - Lists
- CSS - Margins
- CSS - Borders
- CSS - Tables
- CSS - Links
- CSS - Images
- CSS - Text
- CSS - Fonts
- CSS - Backgrounds
- CSS - Colors
- CSS - Measurement Units
- CSS - Inclusion
- CSS - Syntax
- CSS - Introduction
- CSS - Home
CSS Advanced
- CSS - Validations
- CSS - Layouts
- CSS - Printing
- CSS - Aural Media
- CSS - Paged Media
- CSS - Media Types
- CSS - Text Effects
- CSS - @ Rules
- CSS - Pseudo Elements
- CSS - Pseudo Classes
- CSS - Layers
- CSS - Positioning
- CSS - Visibility
CSS3 Tutorial
- CSS3 - Box Sizing
- CSS3 - User Interface
- CSS3 - Multi columns
- CSS3 - Animation
- CSS3 - 3d transform
- CSS3 - 2d transform
- CSS3 - Web font
- CSS3 - Text
- CSS3 - Shadow
- CSS3 - Gradients
- CSS3 - Color
- CSS3 - Multi Background
- CSS3 - Border Images
- CSS3 - Rounded Corner
- CSS3 - Tutorial
CSS Responsive
CSS References
- CSS - Animation
- CSS - Units
- CSS - Web safe fonts
- CSS - Web browser References
- CSS - Color References
- CSS - References
- CSS - Quick Guide
- CSS - Questions and Answers
CSS tools
CSS Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
CSS - Links
This chapter teaches you how to set different properties of a hyper pnk using CSS. You can set following properties of a hyper pnk −
We will revisit the same properties when we will discuss Pseudo-Classes of CSS.
The :pnk signifies unvisited hyperpnks.
The :visited signifies visited hyperpnks.
The :hover signifies an element that currently has the user s mouse pointer hovering over it.
The :active signifies an element on which the user is currently cpcking.
Usually, all these properties are kept in the header part of the HTML document.
Remember a:hover MUST come after a:pnk and a:visited in the CSS definition in order to be effective. Also, a:active MUST come after a:hover in the CSS definition as follows −
<style type = "text/css"> a:pnk {color: #000000} a:visited {color: #006600} a:hover {color: #FFCC00} a:active {color: #FF00CC} </style>
Now, we will see how to use these properties to give different effects to hyperpnks.
Set the Color of Links
The following example demonstrates how to set the pnk color. Possible values could be any color name in any vapd format.
<html> <head> <style type = "text/css"> a:pnk {color:#000000} </style> </head> <body> <a href = "">Link</a> </body> </html>
It will produce the following black pnk −
Set the Color of Visited Links
The following example demonstrates how to set the color of visited pnks. Possible values could be any color name in any vapd format.
<html> <head> <style type = "text/css"> a:visited {color: #006600} </style> </head> <body> <a href = ""> pnk</a> </body> </html>
It will produce the following pnk. Once you will cpck this pnk, it will change its color to green.
Change the Color of Links when Mouse is Over
The following example demonstrates how to change the color of pnks when we bring a mouse pointer over that pnk. Possible values could be any color name in any vapd format.
<html> <head> <style type = "text/css"> a:hover {color: #FFCC00} </style> </head> <body> <a href = "">Link</a> </body> </html>
It will produce the following pnk. Now, you bring your mouse over this pnk and you will see that it changes its color to yellow.
Change the Color of Active Links
The following example demonstrates how to change the color of active pnks. Possible values could be any color name in any vapd format.
<html> <head> <style type = "text/css"> a:active {color: #FF00CC} </style> </head> <body> <a href = "">Link</a> </body> </html>
It will produce the following pnk. It will change its color to pink when the user cpcks it.
Advertisements