Home > Web Front-end > CSS Tutorial > Solution to invalid visited style in css pseudo-class

Solution to invalid visited style in css pseudo-class

黄舟
Release: 2018-05-24 11:04:31
Original
2977 people have browsed it

Incorrect writing method is to write visited after hover and active, for example:

.ui-page-theme-a .digilinx-ui-btn{background:#00a325;border-color:#00891f;color:#FFF;text-shadow: 0 1px 0 #00a325;}
.ui-page-theme-a .digilinx-ui-btn:hover{background:#00891f;border-color:#00721a;color:#FFF;text-shadow: 0 1px 0 #00891f;}
.ui-page-theme-a .digilinx-ui-btn:active{background:#00721a;border-color:#005c15;color:#FFF;text-shadow: 0 1px 0 #00721a;}
.ui-page-theme-a .digilinx-ui-btn:visited{background:#00a325;border-color:#00891f;color:#FFF;text-shadow: 0 1px 0 #00a325;}
Copy after login

The result: the style of the clicked button or link will always be fixed on visited, while the styles of hover and active will not Overwritten

The correct way to write it is to write visited in front, as follows:

.ui-page-theme-a .digilinx-ui-btn{background:#00a325;border-color:#00891f;color:#FFF;text-shadow: 0 1px 0 #00a325;}
.ui-page-theme-a .digilinx-ui-btn:visited{background:#00a325;border-color:#00891f;color:#FFF;text-shadow: 0 1px 0 #00a325;}
.ui-page-theme-a .digilinx-ui-btn:hover{background:#00891f;border-color:#00721a;color:#FFF;text-shadow: 0 1px 0 #00891f;}
.ui-page-theme-a .digilinx-ui-btn:active{background:#00721a;border-color:#005c15;color:#FFF;text-shadow: 0 1px 0 #00721a;}
Copy after login

The above is the detailed content of Solution to invalid visited style in css pseudo-class. 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