Problem Statement
What is the recommended convention for naming CSS classes and IDs?
Explanation
Using lowercase letters with hyphens (kebab-case) or underscores (snake_case) improves consistency and readability. Avoid using spaces or special characters. For example, use main-header or user_profile instead of mixedCase or random naming.
Code Solution
SolutionRead Only
<!-- Example of consistent naming --> <div id="main-header" class="user-profile"> <h1>Welcome</h1> </div>
Practice Sets
This question appears in the following practice sets:
