I want to change the style of the content created by CSS using content: "" property when the user hovers over it.
.breadcrumb li{
display: inline;
}
.breadcrumb li.location+li.location::before {
content: ">";
color: green;
padding-right: 2.5px;
}
li.attribute a:hover {
color:blue;
}
li.attribute::after{
content: "x";
color: gray;
vertical-align: super;
font-weight: 300;
font-size: 15px;
}
SO I want the x to turn red when it's hovered over. I tried using :
li.attribute:hover::after{
color: red;
}
But it's making it red when I hover over the word "Organic" itself as well as the content"x".
HTML:
<ul class="breadcrumb">
<li class="location">
<a href="#">Shop</a>
</li>
<li class="location">
<a href="#">Groceries</a>
</li>
<li class="location">
<a href="#">Blueberries</a>
</li>
<li class="attribute">
<a href="#">Organic</a>
</li>
.breadcrumb li{
display: inline;
}
.breadcrumb li.location+li.location::before {
content: ">";
color: green;
padding-right: 2.5px;
}
li.attribute a:hover {
color:blue;
}
li.attribute::after{
content: "x";
color: gray;
vertical-align: super;
font-weight: 300;
font-size: 15px;
}
li.attribute:hover::after{
color: red;
}
<ul class="breadcrumb">
<li class="location">
<a href="#">Shop</a>
</li>
<li class="location">
<a href="#">Groceries</a>
</li>
<li class="location">
<a href="#">Blueberries</a>
</li>
<li class="attribute">
<a href="#">Organic</a>
</li>