CSS Almanac Tricks

Selectors and Properties

Selectors tells CSS which elements to style while Properties tells CSS what you are changing.

Selectors

  1. :has() selects elements that contain other elements that match the selector passed into argument.Has selector
  2. :empty selects any elements that does not contain children for a given selector.Empty selector

Properties

  1. orphans is the first line of a paragraph that is left behind on the old page while the paragraph continues of the next.Orphans property
  2. widows is the last line of a paragraph that is left alone on a new page or in a new column. Widows property

Summary

In conclusion, by using selectors and properties you are able to create a visually appealing and easy-to-navigate website. You are able to style specific elements on the site, create a consistent look and feel across the site and create a functional navigation bar. Without selectors and properties the website would look plain and users would have a harder time navigating the site.