What are the types …
 
Notifications
Clear all

What are the types of selectors used in CSS?

2 Posts
3 Users
0 Likes
283 Views
0
Topic starter

What are the types of selectors used in CSS?

2 Answers
0

CSS selectors include:

  1. Universal Selector (*)
  2. Type Selector (e.g., p, h1)
  3. Class Selector (.classname)
  4. ID Selector (#id)
  5. Attribute Selector ([attribute])
  6. Attribute Value Selector ([attribute=value])
  7. Descendant Selector (space)
  8. Child Selector (>)
  9. Adjacent Sibling Selector (+)
  10. General Sibling Selector (~)
0

We can divide CSS selectors into five categories: Simple selectors (select elements based on name, id, class) Combinator selectors (select elements based on a specific relationship between them) Pseudo-class selectors (select elements based on a certain state)

Share: