Css - Declaration Block (in style sheet)

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

1 - About

A declaration block starts with a left curly brace ({) and ends with the matching right curly brace (}).

In between, there must be a list of zero or more semicolon-separated (;) declarations.

A declaration block may contain an other declaration block.

Advertising

3 - Grammar

In between the curly braces, there may be any tokens, except that :

  • parentheses (( )), brackets ([ ]) and braces ({ }) ( must always occur in matching pairs and may be nested )
  • Single (') and double quotes (“) ( must always occur in matching pairs )

4 - Example

#dw__toc {
    /* Apply to the div childs of the dw_toc id */
    > div {
        font-size: 0.875em;
        padding: .5em 1em 1em;
    }
web/css/declaration_block.txt · Last modified: 2019/02/09 11:40 by gerardnico