Inline Styles & Colors — Free HTML Tutorial
Learn Inline Styles & Colors in HTML with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Inline Styles & Colors in HTML with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Inline Styles & Colors in HTML
Inline styles use the style attribute directly on elements: <p style="color: red; font-size: 18px;">.
While inline styles work, it is better practice to use <style> tags or external CSS files for maintainability.
Common CSS properties: color (text), background (bg), padding, margin, border, font-size, text-align.
Inline Styles & Colors — Syntax
<p style="color: red; font-size: 18px;">Red text</p> <div style="background: blue; color: white; padding: 20px;">Blue box</div>
Learn Inline Styles & Colors step by step with Syllab's free interactive HTML tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full HTML course →