Skip to the content.
Understanding CSS: Thinking inside the box
- The key to understading how CSS works is to imagine that there is an invisible box around every HTML element.
- CSS allows you to create rules that control the way that each individual box is presented.
CSS associates style rules with HTML elements
- CSS works by associating rule with HTML elements. There rules govern how the content of specified elements should be displayed. A CSS rule contains two parts: a selector and a declaration.
CSS properties affect how elements are displayed
- CSS declarations sit inside brackets and each is made up of two parts: a property and a value, separated by a colon. You can specify several properties in one declaration, each separated by a semi-colon.