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.

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.

✓ 100% Free ✓ No Login Needed ✓ NCERT / CBSE Aligned ✓ Download as PDF

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

🤖 Stuck on any question? Ask Syllab's free AI Tutor for a step-by-step explanation — instant, unlimited, no login.

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 →