The "class" attribute follows some basic syntax and rules that you need to know to use it correctly. First, the "class" attribute is always written inside the opening tag of an HTML element, after the tag name and a space. For example, <div class="container">. Second, the value of the "class" attribute is always written inside double quotes. For example, <span class="highlight">. Third, the value of the "class" attribute can be one or more names separated by spaces. For example, <p class="intro summary">. This means that the element belongs to both the "intro" and the "summary" classes. Fourth, the names of the classes can be any combination of letters, numbers, hyphens, and underscores, but they cannot start with a number or contain spaces. For example, <div class="section-1"> is valid, but <div class="1-section"> or <div class="section 1"> are not.