codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › CSS syntax

CSS syntax

Selector, property, value.

A rule is selector{property:value;}. Several declarations are separated by semicolons.

Example code

<style>
p{color:crimson;font-size:20px;text-align:center}
</style>
<p>Three declarations on one selector</p>

Run this code in the online editor

← CSS introductionCSS how to →