How Many Ways to Select HTML Tag Instances

Q

How Many Ways to Select HTML Tag Instances? - CSS Tutorials - Introduction To CSS Basics

✍: FYIcenter.com

A

If you define a style property for a HTML tag, this definition will apply to all instances of that tag in the entire document. If you want to apply different style property values to different instances of the same tag, you need to use the tag selection mechanisms defined in CSS:

  • Tag Selector - Selects all instances of a HTML tag.
  • Contextual Selector - Selects all instances of a HTML tag nested inside other specified tags.
  • Class Selector - Selects all HTML tags that matches the class name defined in the tag attribute of class="class_name".
  • ID Selector - Selects all HTML tags that matches the id name defined in the tag attribute of id="id_name".
  • Group Selector - Selects multiple HTML tags.
  • Mixed Selector - Selects instances of HTML tags mixed with other selectors.

2007-05-11, 4711👍, 0💬