Home > Article > Web Front-end > Solution to invalid visited style in css pseudo-class
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!