Skip to main content
D
HTML
HTML Styles

HTML Styles

The HTML style attribute is used to add styles to an element.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

Setting the style of an HTML element, can be done with the style attribute. You can change colors, fonts, size, and more.

Syntax

Syntax
1<tagname style="property:value;">

Try it Yourself

Hands-on Practice
Modify the code below to see how it affects the output. This is the best way to learn!
Interactive Editor
1234567891011121314151617181920
Live Preview

Up Next

Continue your journey with the next topic.

Go to HTML Formatting