
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
Standard Link Styles in CSS
We can style links as per our requirements. It is recommended that links have styles which distinguish them from normal text. The default link styles for different link states is as follows −
Link State | Color |
---|---|
Active | #EE0000 |
Focus | #5E9ED6 or a similar shade of blue outline in case of Windows and Mac, #F07746 outline for Linux while text color remains the same |
Hover | #0000EE |
Link | #0000EE |
Visited | #551A8B |
Note − The above colors may change with newer versions of browsers. For proper functionality, the order of pseudo selectors is given by:- :link, :visited, :hover, :active.
Example
The following examples illustrate standard link styles
<!DOCTYPE html> <html> <head> <style> * { text-align: center; } </style> </head> <body> <h2>Learn JDBC</h2> <a href="">Click here</a> <br/><br/> <a href="#">And here <img src="https://www.tutorialspoint.com/jdbc/images/jdbc-mini-logo.jpg"></a> </body> </html>
Output
This gives the following output −
The active state of link is shown in the following output −
Example
<!DOCTYPE html> <html> <head> <style> #one { color: black; text-decoration: none; } #two { font-style: italic; box-shadow: inset 0 0 8px coral; } table, td { font-size: 1.4em; padding: 8px; text-align: center; border: thin solid; } </style> </head> <body> <table> <tr> <td><a id="one" href="#">1</a>(non standard link)</td> <td id="two"><a href="#">2</a></td> </tr> <tr> <td><a href="">3</a></td> <td><a href="#">4</a></td> </tr> </table> </body> </html>
Output
This gives the following output −
As we click "2" we get the following output
- Related Articles
- Set typography and link styles in Bootstrap
- Add different styles to hyperlinks using CSS
- How to change css styles of elements in JavaScript?
- How to import styles from another style sheet in CSS
- Role of CSS :link Selector
- Prime CSS Marketing Link Colors
- Usage of :link pseudo-class in CSS
- How to change link color in CSS?
- How to disable a href link in CSS?
- Style the active link with CSS
- Set the link color with CSS
- CSS styles that every developer should know which are amazing
- Using CSS :placeholder-shown to Customize Styles for Empty Text Input
- Create a link button with borders using CSS
- Styling different states of a link using CSS

Advertisements