Four states in the css style of the a tag
This article mainly introduces the four states in the css style of the a tag. It has certain reference value. Now I share it with you. Friends in need can refer to it.
There are four states in the a tag The sequence of "status" is: a:link ->a:hover ->a:active ->a:visited. In addition, a:active cannot be set with or without an underscore (it is always present). There is an example below that you can look at.
represents connections in all states, such as a{color:red}
① a: link: Unvisited link, such as a:link {color:blue}
② a:visited: Visited link, such as a:visited{color:blue}
③ a:active: When activated (the link gets focus when) the color of the link, such as a:active{color:blue}
④ a:hover: when the mouse moves over the link, such as a:hover {color:blue}
Generally a:hover and a:visited The status of the link (color, underline, etc.) should be the same.
The first three correspond to the link, vlink, and alink attributes of the body element respectively.
The sequence of the four "states" is: a:link ->a:hover ->a:active ->a:visited. In addition, a:active cannot be set with or without underline (it is always present).
Example: Common status values of pseudo-classes
<style type = “text/css”> a {font-size:16px} a:link {color: blue; text-decoration:none;} //未访问:蓝色、无下划线 a:active:{color: red; } //激活:红色 a:visited {color:purple;text-decoration:none;} //已访问:purple、无下划线 a:hover {color: red; text-decoration:underline;} //鼠标移近:红色、下划线 </style>
The above is the entire content of this article. I hope it will be helpful to everyone's learning. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
CSS
Introduction to the use of Border attribute solid
Explanation of css mouse style cursor
The above is the detailed content of Four states in the css style of the a tag. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

index.html represents the home page file of the web page and is the default page of the website. When a user visits a website, the index.html page is usually loaded first. HTML (HypertextMarkupLanguage) is a markup language used to create web pages, and index.html is also an HTML file. It contains the structure and content of a web page, as well as tags and elements used for formatting and layout. Here is an example index.html code: <

To remove the inherent color of the a tag, you can use the following method: Use the CSS color property to specify the text color. Use the CSS link-color property to specify link color. Use the CSS text-decoration property to remove underline and default text color. Use the CSS hover color property to change the text color on mouseover. Use the CSS visited color property to change the text color of visited a tags.

a tag to create a hyperlink, and then through the a tag, you can link one page to another page. Detailed introduction: To achieve page jump, you need to fill in the URL of the target page into the href attribute. The URL can be a relative path or an absolute path. The relative path is the path relative to the current page, and the absolute path is the complete URL. address.

When writing a website or application, you often encounter the need to jump to a specific page. In PHP, we can achieve page jump through several methods. Below I will demonstrate three common jump methods for you, including using the header() function, using JavaScript code, and using meta tags. Using the header() function The header() function is a function used in PHP to send original HTTP header information. This function can be used in combination when implementing page jumps. Below is a

Title: Implementation method of page jump in 3 seconds: PHP Programming Guide In web development, page jump is a common operation. Generally, we use meta tags in HTML or JavaScript methods to jump to pages. However, in some specific cases, we need to perform page jumps on the server side. This article will introduce how to use PHP programming to implement a function that automatically jumps to a specified page within 3 seconds, and will also give specific code examples. The basic principle of page jump using PHP. PHP is a kind of

The problem of Chinese garbled characters in PHP web pages is that Chinese characters are displayed as garbled characters in the web page display. This situation is usually caused by inconsistent encoding or the character set is not set. Solving the problem of Chinese garbled characters in PHP web pages requires starting from many aspects. The following are some common solutions and specific code examples. Set the PHP file encoding: First make sure that the encoding of the PHP file itself is UTF-8. You can set the UTF-8 encoding when saving in the editor, or add the following code to the header of the PHP file to set the encoding: &l

How to create a slide layout page using HTML and CSS Introduction: Slide layout is widely used in modern web design and is very attractive and interactive when displaying information or pictures. This article will introduce how to create a slide layout page using HTML and CSS, and provide specific code examples. 1. HTML layout structure First, we need to create an HTML layout structure, including a slide container and multiple slide items. The code looks like this: <!DOCTYPEhtml&

The a tag attributes are: 1. href; 2. target; 3. rel; 4. download; 5. hreflang; 6. type. Detailed introduction: 1. href, which defines the target URL of the link. This is the most commonly used attribute of the "<a>" tag. It can link to any part of the web page, such as the top of the page, a specific paragraph, etc.; 2. target, which defines the link in Where to open; 3. rel, defines the relationship of the link. This attribute allows specifying the relationship between the current document and the linked document, etc.
