HTML Styles
Learn inline styles using style attribute, and why CSS is better for large projects.
David Miller
January 12, 2026
0.7k32
HTML can style using the style attribute.
This is called inline style.
Example
<h1 style="color: blue;">Welcome</h1>
<p style="font-size: 18px;">This text is bigger.</p>
Preview
Welcome (blue)
This text is bigger.
When to use inline styles
- small quick tests
- not recommended for full websites
Better way
Use CSS file later (we will cover).
#HTML#Beginner