CSS Rules

Contact Us or call 1-877-932-8228
CSS Rules

CSS Rules

CSS rules are statements that define the style of an element or group of elements. The syntax is as follows:

selector { property: value; property: value; property: value; }

Each property:value pair is a declaration. Multiple declarations are separated by semicolons. The selector defines which elements are affected by the rule. Take a look at the following rule:

p { color: darkgreen; font-family: Verdana; font-size: 10pt; }

This rule specifies that all paragraph text should be darkgreen and use a 10-point Verdana font.

CSS Comments

Comments in CSS begin with "/*" and end with "*/". See the example below.

p { color: red; /* All paragraphs should be red */ }