CSS tags

In CSS, tags are used to select and style HTML elements. Here are some common CSS tags:

  • body: Applies styles to the entire body of the document

  • h1, h2, h3, h4, h5, h6: Selects heading elements and allows you to style them accordingly

  • p: Targets paragraphs and allows you to style them

  • a: Used to select and style hyperlink tags

  • img: Targets image tags and allows you to style them

  • ul, ol: Targets unordered and ordered list elements respectively and allows you to style them

  • li: Targets list items within a list and allow you to style them

  • div: Used to create a container element that you can then style, often used for layouts

  • span: Similar to div, but used to select inline elements, such as text or images, rather than creating a container element

Here's an example of applying styles to the h1 and p tags:

h1 {
  color: red;
  font-family: Arial, sans-serif;
}

p {
  color: #333;
  font-size: 18px;
  line-height: 1.5;
}

In this example, we're setting the text color and font family of all <h1> elements to red and Arial, respectively. For <p> elements, we're setting the text color to a darker gray, increasing the font size to 18 pixels, and setting the line height to 1.5.