Get the App
SLTechnology News&Howtos  ›  Development  › 

How to understand the CSS pseudo-class of CSS that controls the display status of links

Shulou Source: shulou.com Published: 2022-06-03 07:50:45 11月15日 Update

This article to share with you is about how to understand CSS control link display state CSS pseudo-class, Xiaobian feel quite practical, so share to everyone to learn, I hope you can read this article after some harvest, not much to say, follow Xiaobian to see it.

CSS controls certain states of elements---pseudo-classes (used to add special effects to certain selectors)

Pseudo-class syntax: element label Pseudo-class name {attribute: attribute value;}

a:link: link not visited

a:hover: mouse over link

a:active: mouse down link

a:visited: links visited

If you return to the page after clicking, and there are some effects, add the status L V H A to the link in that order.

CSS classes for custom links:

a. Class name: status (i.e. selector. Class Name: Pseudo Class Name {Attribute: Attribute Value})

The code is as follows:

CSS control links-CSS pseudo-classes

a:link{text-decoration:none; color:#000;}

a:visited{text-decoration:none; color:#6F0;}

a:hover{text-decoration:underline; color:#00F;}

a:active{text-decoration:overline; color:#F00;}

a.web:visited{text-decoration:none; color:#000;}

web design|

graphic design|

Website Front End|

animation design|

software development|

Web Marketing

I can flash.

:focus{attribute: attribute value} Sets the style of the object when it becomes the focus of input (not supported in IE 6/7)

The code is as follows:

CSS control links-CSS pseudo-classes

input{

width:200px;

height:25px;

border:2px solid #FF0;

}

input:focus{

background:#9FF;

}

User Name:

Code:

The above is how to understand CSS control link display state CSS pseudo-class, Xiaobian believes that some knowledge points may be our daily work will see or use. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Links attributes status controls class names design code elements effects more knowledge articles web pages mice selection practical special front end animation animation design Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL macOS Microsoft Huawei