Safeer Ahmed
Safeer Ahmed

Reputation: 625

What are valid values for the class attribute in HTML?

When creating the class attributes for HTML elements, what rules are there for the value?

Upvotes: 0

Views: 887

Answers (2)

HTML class Attribute Values

Naming rules:

  • Must begin with a letter A-Z or a-z
  • Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"), and underscores ("_")
  • In HTML, all values are case-insensitive

https://www.w3schools.com/TAGs/att_global_class.asp

Upvotes: 0

Related Questions