0

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

Safeer Ahmed
  • 587
  • 6
  • 14

2 Answers2

1

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

  • Are the class naming rules similar to id naming rules in HTML? – Safeer Ahmed Oct 02 '17 at 04:58
  • @SafeerAhmed, yes you're right, the same rules apply to HTML id Attribute https://www.w3schools.com/TAGs/att_global_id.asp . "`id` - Specifies a unique id for the element. Naming rules: Must contain at least one character Must not contain any space characters In HTML, all values are case-insensitive" – chickity china chinese chicken Oct 02 '17 at 05:01