Reputation: 336
I would like to know if a pseudo class can be placed for a specific class. For instance,
<p> You can get youtube <a class="video" href="www.video.com"> here </a> </p>.
What I want to do is to create a css file for class video within itself and access pseudo classes like hover,active and visited.
I know one way of doing it is
<p> <span class="video"> You can get video <a href="www.video.com"> here </a> </span> </p>
And write css file as
.video a:hover{something}
.video a:active{something}
But I don't want to use the span/div for it. I would like to write my html as
<a class="something" href="something.com">
and still access the pseudo classes of "a" for the class "video". Is it possible?
Upvotes: 0
Views: 1525
Reputation: 571
In your file video.css, you can do something like that :
.video:hover {
color: #ff0000;
}
Pseudo class will be applied on all tag with class video.
You can also write something like this if class video can be on other tag than "a" tag :
a.video:hover {
color: #ff0000;
}
Pseudo class will be applied only on "a" tag with class video. Note that there is no space between "a" and ".video" because the class video is on "a" tag.
Upvotes: 2