Styling HTML elements

CSS provides various ways to select and style HTML elements:

tag
Element Selectors
Target elements by their HTML tag name
grid_view
Class Selectors
Target elements with a specific class attribute
fingerprint
ID Selectors
Target a unique element with a specific ID
/* Element selector */
h1 {
  color: blue;
  font-size: 24px;
}

/* Class selector */
.highlight {
  background-color: yellow;
}

/* ID selector */
#main-title {
  text-align: center;
}
Visual Examples
This is an h1 element
Styled with element selector
This has a highlight class
Styled with class selector
This has the main-title ID
Styled with ID selector