codegurukool.com · Free coding tutorials & online compiler

Home › HTML Tutorial › HTML styles

HTML styles

Style one element with the style attribute.

The style attribute takes CSS declarations. It is quick, but a stylesheet is better for many elements.

Example code

<p style='color:tomato;font-size:24px;background:#eee'>Styled inline</p>'

Run this code in the online editor

← HTML elementsHTML formatting →