Css - Declaration Block (in style sheet)

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.

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 )

Example

#dw__toc {
    /* Apply to the div childs of the dw_toc id */
    > div {
        font-size: 0.875em;
        padding: .5em 1em 1em;
    }





Discover More
CSS - Block And Inline Layout (Block Formatting context)

CSS - Block And Inline Layout (Block Formatting context) CSS Block and inline layout is the first layout model of CSS. It's also known as: * block formatting * flow layout The component are laid...
Css - Declaration

Declaration are syntactic expressions that are contained in a declaration block to create a rule A declaration: is either empty or has two parts (separated by a colon (:) and optionally surrounded...
Css - Rule (Set|Declaration)

In a CSS stylesheet, your write several rules to define your presentation. A rule set (also called “rule”) consists of: a selector list followed by a declaration block. (one of several declarations)...



Share this page:
Follow us:
Task Runner