HTML Styles
Learn inline styles using style attribute, and why CSS is better for large projects.
David Miller
Jan 11, 2026
30.5k1,006
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