Element-specific selectors


show more Element-specific selectors provides you with in-depth training on Web. Taught by James Williamson as part of the CSS: Core Concepts show less
please wait ...

Element-specific selectors

In many cases, CSS allows us to tweak our syntax slightly to achieve more focused targeting goals. When writing class and ID selectors you can also make them element-specific, meaning they will only apply when those attributes are applied to a specific element type. To maybe make more sense if that, I have got a page here opened in the browser, and this is the element-specific.htm, which is found in the 02_06/Chapter_02 directory, and it's exactly what we had in our last lesson for the most part.

We have all of these artists targeted with a class attribute of artist, and then they are being styled with a class selector of artist. But maybe we don't want them all styled exactly the same. For example, the name of the artists here in the headline probably shouldn't look exactly the same way it does in the body copy everywhere, but right now that artist selector is applying to the entire page. So let's go take a look at how we can maybe modify the selector a little bit and make...

Element-specific selectors
Video duration: 4m 35s 8h 52m Beginner

Viewers:

Element-specific selectors provides you with in-depth training on Web. Taught by James Williamson as part of the CSS: Core Concepts

Subject:
Web
Software:
CSS
Author:
please wait ...