link is not a new style rule in css3. ":link" is a selector that can be used before CSS3. It can be used to set the style of links. This selector is used to select links that have not been visited. It will not set the style of links that have been visited. The syntax is "a: link{css style code}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
: The link selector is used to select unvisited links.
Note: The :link selector does not style links that have already been visited.
Tip: Please use the :visited selector to style links pointing to visited pages, the :hover selector to set the style when the mouse pointer floats over the link, and the :active selector to set the style when the link is clicked. style.
The four link statuses are:
a:link - normal, unvisited link
a: visited - the link that the user has visited
a:hover - when the user mouses over the link
a:active - the link is The moment you click
The example is as follows:
<!DOCTYPE html> <html> <head> <style> a:link {color:blue;} a:visited {color:blue;} a:hover {color:red;} a:active {color:yellow;} </style> </head> <body> <p>将鼠标指针移动到这个链接上:<a href="http://www.php.cn">PHP中文网</a></p> </body> </html>
Output result:
(Learning video sharing:css video tutorial, html video tutorial)
The above is the detailed content of Is link a new style rule in css3?. For more information, please follow other related articles on the PHP Chinese website!