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

Solution to invalid visited style in css pseudo-class

黄舟
黄舟Original
2018-05-24 11:04:312882browse

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;}

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;}

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!

Statement:
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