I\'m trying to style my element with pseudo-class and pseudo-element. like hover::before
is working perfectly but :visited::before
is not working.
It is easy, if you have a span next to it:
*, *:before, *:after {
box-sizing: border-box;
}
body {
background-color: #eee;
font-size: 23px;
padding: 50px;
font-family: 'Ubuntu Condensed', sans-serif;
}
.seen {
margin: 20px;
float: left;
padding: 20px 20px 20px 20px;
border: 1px solid #ccc;
background-color: #fff;
position: relative;
text-decoration: none;
}
.seen {
color: green;
}
.seen:visited {
color: red;
}
.seen + span {
color: #fff;
margin-left: 20px;
}
.seen:visited + span {
color: #ccc;
margin-left: 20px;
}
Seen Effects Seen
Seen Effects Seen
Seen Effects Seen
This doesn't work in Chrome, but works in Chromium!