Home Web Front-end CSS Tutorial What does link mean in CSS?

What does link mean in CSS?

Nov 16, 2020 am 10:20 AM
css

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use the locally installed 'Jingnan Mai Round Body' on a web page and solve the display problem? How to use the locally installed 'Jingnan Mai Round Body' on a web page and solve the display problem? Apr 05, 2025 pm 02:06 PM

How to use locally installed font files on web pages In web development, users may want to use specific fonts installed on their computers to enhance the network...

What exactly is the merge of CSS vertical margins? What exactly is the merge of CSS vertical margins? Apr 05, 2025 am 09:12 AM

In-depth understanding of CSS vertical margin merging In CSS style design, vertical margin merging is a common problem, which refers to adjacent block-level elements...

How to adapt and adjust the label size of the Element-UI horizontal menu el-menu on the PC and mobile side? How to adapt and adjust the label size of the Element-UI horizontal menu el-menu on the PC and mobile side? Apr 05, 2025 am 10:12 AM

The adaptation issues of the Element-UI menu component el-menu and label size adjustment During the development process of using the Element-UI framework, the flexibility and ease of use of the el-menu component...

Element-UI el-menu component: How to adjust the size of menu labels and control the display of submenu in different modes? Element-UI el-menu component: How to adjust the size of menu labels and control the display of submenu in different modes? Apr 05, 2025 am 10:36 AM

The label size adjustment of the Element-UI menu component el-menu and the behavior differences under the mode attributes of the Element-UI menu component will be used to determine the different mode modes of the el-menu component in the Element-UI framework...

How to use CSS to achieve a gradient effect of the background color transition from left to right and gradually becoming lighter from top to bottom? How to use CSS to achieve a gradient effect of the background color transition from left to right and gradually becoming lighter from top to bottom? Apr 05, 2025 pm 12:57 PM

CSS gradient color effect implementation: Gradient background color from top to bottom In web design, how to transition from left to right in the search box and the background color under the carousel image...

How to customize resize symbols through CSS to match background color? How to customize resize symbols through CSS to match background color? Apr 05, 2025 pm 02:09 PM

How to customize resize symbols with CSS to match background color? In web design, the details of the user experience can often significantly improve the overall effect. For example...

How to solve the problem of page jitter caused by dynamically setting elements to fixed in JavaScript? How to solve the problem of page jitter caused by dynamically setting elements to fixed in JavaScript? Apr 05, 2025 am 11:39 AM

How to solve the problem of page jitter caused by dynamically setting elements to fixed by JS. When dynamically setting elements to fixed by JavaScript, you sometimes encounter page jitter...

Under a fixed width layout, what is the relationship between the font size and the letter width? Under a fixed width layout, what is the relationship between the font size and the letter width? Apr 05, 2025 pm 12:51 PM

Under fixed width layout, the subtle relationship between font size and letter width When designing web pages, we often encounter the need to line up in fixed width containers...

See all articles