What does link mean in CSS?

藏色散人
Release: 2020-11-30 11:16:08
Original
8975 people have browsed it

Link in CSS refers to a CSS link. Different links can have different styles, and the link style can use any CSS attribute. There are 4 link states, namely: 1. "a:link" ;2. "a:visited"; 3. "a:hover"; 4. "a:active".

What does link mean in CSS?

The operating environment of this tutorial: Windows 10 system, CSS3, this article is applicable to all brands of computers.

CSS Link

Different links can have different styles.

Link style

The link style can use any CSS properties (such as color, font, background, etc.).

Special links can have different styles, depending on their status.

The four link statuses are:

a:link - normal, unvisited link

a:visited - link that the user has visited

a:hover - when the user mouses over the link

a:active - the moment when the link is clicked

Example

a:link {color:#000000;}      /* 未访问链接*/
a:visited {color:#00FF00;}  /* 已访问链接 */
a:hover {color:#FF00FF;}  /* 鼠标移动到链接上 */
a:active {color:#0000FF;}  /* 鼠标点击时 */
Copy after login

When set to several links There are also some order rules for status styles:

a:hover must follow a:link and a:visited

a:active must follow a:hover

Common link styles

Based on the example of the color change of the link above, see what state it is in.

Let’s move on to link styling through some other common ways:

Text-decoration

The text-decoration attribute is mainly used to remove underlines from links:

Example

a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {text-decoration:underline;}
a:active {text-decoration:underline;}
Copy after login

Background Color

The background color attribute specifies the link background color:

Example

a:link {background-color:#B2FF99;}
a:visited {background-color:#FFFF85;}
a:hover {background-color:#FF704D;}
a:active {background-color:#FF704D;}
Copy after login

The above is the detailed content of What does link mean in CSS?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template