DEV Community

Joshua Jones
Joshua Jones

Posted on • Updated on

Learning CSS Part 2

  • If you want to change a section like a header, you must include the tag in front the bracket. Ex= h1{color:ex}

  • Using * tag selects all and makes it universal

  • To select an HTML element by its class using CSS, a period (.) must be prepended to the class’s name. In the example above, the class is brand, so the CSS selector for it is .brand.

  • If there are multiple classes, you can create different rule sets or include both using space in html.

Image description

The ID attribute has only one value compared to the class. To select an ID , you must use a hashtag #

The attribute selector targets elements that already contain attributes. You use [ ] to select them.
Image description

  • Psuedo class: ex focus, visited, disabled, active that creates user interaction.

Image description

  • different ways of selecting an element. By type, class and ID.

Image description

  • Chaining combines multiple sectors.
  • ex: h1.special the (.) connects two different elements.
  • A descendant combinator selects all elements within a list.

Image description

You can add more styles to multiple selectors. Separate the CSS selectors with a comma.

Top comments (0)