Css - Rule (Set|Declaration)

> (World Wide) Web - (W3|WWW) > CSS - Cascading Style Sheets - Markup Language (HTML|XML) Skin

1 - About

In a CSS file, your write several rules to define your presentation.

A rule set (also called “rule”) consists of:

Advertising

3 - Syntax

selectorList { 
         property: value; 
         [more property:value; pairs] 
}

where:

  • selectorList
selector[:pseudo-class] [::pseudo-element] [, more selectorlists]

4 - Example

The CSS rule

 h1 { 
    color: red;
    font: Consolas;
}

where:

The HTML

<h1>This text will be red with the font Consolas</h1>

The result

Advertising
web/css/rule.txt · Last modified: 2019/03/24 20:38 by gerardnico