×

CSS Links

CSS Link is used to create styled link. There are various ways to implement it.

Styling Links

Link can be styled with CSS properties like color, font-family, background etc. Example:
<!DOCTYPE html>  
<html>  
<head>  
<style>  
a {  
    color: red;  
}  
</style>  
</head>  
<body>  
<p><b><a href="https://www.tutorialandexample.com"   
target="_blank">This is a link</a></b></p>  
</body>  
</html>
Try Now

There are four states of links

  • a:link : A normal, unvisited link.
  • a:visited : A link the user has visited.
  • a:hover : A link when the user mouse over it.
  • a:active : A link the moment it is clicked.
Example:
/* unvisited link */
a:link {  
    color: yellow;  
}  
/* visited link */  
a:visited {  
    color: red;  
}  
/* mouse over link */  
a:hover {  
    color: orange;  
}  
/* selected link */  
a:active {  
    color: blue;  
}
Note:
    • a:hover MUST come after a:link and a:visited.
    • a:active MUST come after a:hover.

Text Decoration

Text Decoration property is used to remove hte underlines from links:. Example
a:link {  
    text-decoration: none;  
}

Advanced Link Buttons

The example of advance link button uses several CSS properties to display the link as box/buttons: Example
<!DOCTYPE html>  
<html>  
   <head>  
      <style>  
         a:link, a:visited {  
         background-color:orange;  
         color: white;  
         padding: 14px 25px;  
         text-align: center;  
         text-decoration: none;  
         display: inline-block;  
         }  
         a:hover, a:active {  
         background-color: red;  
         }  
      </style>  
   </head>  
   <body>  
      <a href="https://www.tutorialandexample.com">This is a link</a>  
   </body>  
</html>
Try Now

Related Topics

CSS Table

CSS table provides better look and feel. There are various properties of CSS table that are given below. border border-collapse padding width height text-align color background-color CSS Table Border You can set...

4 minutes read.

CSS calc()

CSS calc(): The CSS calc() function is a CSS function of inbuilt type, which permits us to implement calculations. It is used for calculating the angle, integer frequency, number, time,...

3 minutes read.

CSS Important

CSS Important: CSS !important property is used to provide more importance, as compared to other CSS properties. The meaning of this property is “This is important.” This property enables CSS...

2 minutes read.

CSS Background-blend-mode

Background-blend-mode The background-blend-mode property sets a blend mode of the component’s every background layer (color/image). It illustrates how the element background image blends well with the element background color. We can...

9 minutes read.

How to use google fonts in CSS

Fonts: - Fonts are used to make our website look more beautiful. Choosing appropriate font according to the web design or layout is also important. Many typefaces are accessible in...

4 minutes read.

CSS Overflow

CSS Overflow: The Overflow property in CSS is used to manage the content if it overflows from its container of the block level. We have seen that all the elements...

3 minutes read.

CSS Font-Size

A Cascading Style Sheet (CSS) is a simple design scripting language intended to simplify the process of making web pages more visually appealing with the kind of high-level formatting. Cascading...

3 minutes read.

How to get rid/remove of bullet pioints in CSS

We include a list of items on the web pages that were sometimes numbered and sometimes bulleted in various styles. In HTML, there are two kinds of lists: ordered and unordered...

3 minutes read.

CSS Text-Transform Property

Text-Transform in CSS The text-transform property permits us to alter the text case. It controls the capitalization of the text. This property is employed to design the text appearance in every...

3 minutes read.

CSS Radio Button

Radio Button A radio button has been defined as an element of HTML. It can support us to take any input from the user. But it is challenging to design a...

4 minutes read.

CSS Arrow

CSS Arrow The arrow of CSS is applied to insert an array with the tooltip. It can make a tooltip as any speech bubble. Also, this arrow can be illustrated in...

4 minutes read.

CSS Units

CSS Units In CSS, there are so many units available to show the length’s measurement. A single unit of CSS is applied to examine the size of the property, which the...

5 minutes read.

CSS Display

CSS Display: The CSS Display property is one of an essential property among all other properties of CSS. The display property specifies how the HTML elements should be displayed on...

4 minutes read.

CSS 2d Transform

Transform property in CSS is used mainly for enhancing the effects and to animate the elements. Transform is an effect that changes the shape, size and position of an element. It helps...

6 minutes read.

CSS 3D Transform

Introduction To understand 3D transformation property of transform you need to first understand the difference between 2D and 3D transform. 2D transform is a CSS effect which transforms the elements according to...

6 minutes read.

Cascading Style Sheet

CSS refers to the Cascading Style Sheet. CSS is a form of a programming language. In other words, CSS is a language of the style sheet that is utilised for...

7 minutes read.

CSS Text-decoration

CSS Text-decoration: It is an essential property of CSS that is used to decorate the content of the text. It can add-on the lines above, under, and over the text....

3 minutes read.

CSS Functions

CSS functions are used for different CSS properties. Every front-end developer should have knowledge of all CSS functions. It makes the coding easier. FunctionsExplanationattr().It returns the value of an attribute of...

5 minutes read.

CSS Visibility

Visibility in CSS: This visibility property in CSS is employed to describe whether the components are visible or not. Note: An invisible component also grabs the space over the page. If...

2 minutes read.

CSS Button Style

CSS button style: Using CSS properties, we can easily modify the default BUTTON and enhance its appearances using simple graphic commands. TYPES OF BUTTON STYLE: - Program to change button using CSS ...

35 minutes read.