The Elements Layer: Unclassed HTML Styling
You'll learn how to create baseline styles for bare HTML elements before adding any classes.
What Is the Elements Layer?
In the ITCSS architecture you've been learning, the Elements Layer sits right after Generic (resets/normalize) and establishes default styling for plain HTML tags—those without any classes attached. Think of this as setting the "factory defaults" for your site's typography and basic element appearance.
This layer answers questions like: "What should all <h1> tags look like?" or "How should all links appear by default?"
Why Style Unclassed Elements?
Instead of writing this:
.heading-main { font-size: 2rem; }
.heading-secondary { font-size: 1.5rem; }
...and adding classes everywhere, you first style the elements themselves:
/* Elements Layer */
h1 {
font-size: 2rem;
font-weight: 700;
line-height: 1.2;
}
p {
margin-bottom: 1rem;
line-height: 1.6;
}
a {
color: #0066cc;
text-decoration: underline;
}
Now every heading, paragraph, and link has sensible defaults before you add specific classes for variations.
The Analogy
Think of the Elements Layer as the "house paint" color—it covers every wall. Later layers (Objects, Components, Utilities) are like accent walls and decorations for specific rooms. You want good base coverage before adding details.
Practical Scope
Style typography fundamentals (h1–h6, p, blockquote), links (a), lists (ul, ol), and basic semantic elements (strong, em, code). Keep it minimal and sensible—this is your baseline, not your final design.
Key Takeaway: The Elements Layer establishes default styling for bare HTML tags, creating consistent typography and appearance before any classes are applied—setting your project's visual foundation.