From the course: CSS Essential Training
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Type and universal selectors - CSS Tutorial
From the course: CSS Essential Training
Type and universal selectors
- [Instructor] In CSS, selectors are used to select specific HTML elements and apply styles to them. Different types of selectors are used to determine which element the style should be applied to. Let's start by taking a look at how to use two basic selectors, type and universal. Type selectors are sometimes called an element selector, and they match to HTML elements by using the element name but without the angled brackets. For example, to apply a style to all the h2 elements on your webpage, use h2 as the selector. The universal selector can be used to select every single element in the whole document. The syntax is represented by a single asterisk. Using the universal selector can impact performance since it applies the styles to all elements on the page which is why it's not used very often. There are some special use cases which we'll discuss in more detail later in the course. Let's practice using selectors with a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
CSS specifications and the W3C3m 12s
-
(Locked)
CSS syntax and terminology4m 2s
-
(Locked)
CSS values and units3m 33s
-
(Locked)
The color property and values4m 31s
-
(Locked)
Creating a color palette1m 52s
-
(Locked)
Type and universal selectors3m 16s
-
(Locked)
ID selectors2m 34s
-
(Locked)
Class selectors3m 17s
-
(Locked)
Descendant combinators and selector lists2m 56s
-
(Locked)
The background property4m 39s
-
(Locked)
Project: Prepping the CSS file4m 5s
-
(Locked)
Project: Adding background styles7m 39s
-
(Locked)
Pseudo-classes and pseudo-elements4m 30s
-
(Locked)
Inheritance and the cascade2m 20s
-
(Locked)
Specificity3m 45s
-
(Locked)
Project: Styling links5m 23s
-
-
-
-
-
-
-