Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

One style set for multiple selectors

One style set for multiple selectors

Problem

I want to apply css styles to a tags of single class .video-title Tried to use

.video-title a, .video-title a:link, .video-title a:visited{...}

and

.video-title a, a:link, a:visited {...}

First one doesn't apply styles, second one applies for all a tags. What's wrong with syntax?

Problem courtesy of: Tural Aliyev

Solution

.video-title a applies the style to all a elements that are bellow a element with video-title class. e.g:

Link

In order to select all a element with the video-title class you have to do

a.video-title:hover, a.video-title:visited, a.video-title:whatever {...} 

instead of

.video-title a
Solution courtesy of: Cesar Canassa

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

One style set for multiple selectors

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×