Articles

Affichage des articles du septembre, 2007

Feuilles de Styles en Cascade

CSS A CSS rule-set consists of a selector and a declaration block. The selector points to the HTML element you want to style. The declaration block contains one or more declarations separated by semicolons. Each declaration includes a CSS property name and a value, separated by a colon. A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by curly braces. In the following example all <p> elements will be center-aligned, with a red text color: <code> p { color: red; text-align: center; } </code> ===== CSS selectors ===== ==== The element Selector ==== The element selector selects elements based on the element name. <code> p { color: red; text-align: center; } </code> ==== The id Selector ==== The id selector uses the id attribute of an HTML element to select a specific element. The id of an element should be unique within a page, so the id selector is used to select one unique element! To select an element with a specific id