HTML Styles
HTML Styles
HTML style attributes are used to change the appearance of elements. With the style attribute, you can add formatting such as colors, fonts, sizes, and more.
Example Code
Output Preview
This will appear like:
-
A blue-colored text
-
A larger font paragraph
-
A paragraph with yellow background
Common Style Properties
| Property | Description |
|---|---|
color |
Changes text color |
font-size |
Changes text size |
background-color |
Adds background color |
text-align |
Aligns text (left, center, right) |
font-family |
Changes the font style |
Another Example:
Using styles helps make web content more attractive and readable.
