Selectors

To use CSS, we use selectors to choose what part of our page we would like to apply our new rules to.

tutorial

Recall our earlier example. h1,h2, h3 are all selectors. In this case we are applying the same rules to all three.

Now inside of our html we can create ids and classes and assign them certain elements.

tutorial

The point of this is so we can give specific parts of our webpage rules, without affecting the rules of all elements that may share the sam tag, we can apply css rules to them specifically.

Here are some Selector examples:
tutorial
tutorial
tutorial
tutorial

We can further specify which element we want to select based on attributes. Here are the type of attribute selectors that we can use.

tutorial

NEXT LESSON