css-syntax Flashcards
What are the names of the individual pieces of a CSS rule?
The names of the individual pieces of a CSS rule are the selector, declaration block, declarations, properties, and values. The selector goes before the declaration block. Declarations are inside the block and have properties and values.
In CSS, how do you select elements by their class attribute?
To select an element by their class attribute, use the class selector which has a period before the class name in the css stylesheet. An example would be “.title{ property: value }
In CSS, how do you select elements by their tag name?
To select an element by their tag name simply enter the name of the tag such as body, h1, h2, img; then add property value combinations.
In CSS, how do you select an element by its id attribute?
To select an element by its id attribute, in the CSS stylesheet add a # before the id attribute name. An example would be: “#title { property: value }”