Reputation: 309
I have am running the selector
.element a:after { content: url("...."); }
But what I am wanting to make sure is that it clears the :after on the last of type, and so I want something like this to happen:
.element a:after:last-of-type { content: url("....") } /* Note that I am changing the image to a blank spacer */
How can I do this?
Matt
Upvotes: 2
Views: 482
Reputation: 241198
Change the order of the pseudo classes/elements. Put :last-of-type
before :after
:
.element a:last-of-type:after {
content: url("....");
}
Based on the HTML structure you posted in the comments: (example)
<ul id="breadCrumb">
<li><a href="#">Dashboard</a></li>
<li><a href="#">Home</a></li>
</ul>
You would use :last-of-type
on the li
element:
#breadCrumb li a:after {
content: url('....');
}
#breadCrumb li:last-of-type a:after {
content: url("....");
}
Upvotes: 2