CSS Selectors, Properties and Declarations Flashcards
What is a CSS selector
A HTML tag you want to affect using CSS
How does CSS a selector appear
A HTML tag without brackets
What do CSS properties do
Alter specific attributes of a selector
What is a declaration for a CSS selector
Specifying values for CSS properties
What are the CSS declaration and selector together referred to as
A set of rules or ruleset
In a typical CSS ruleset, what is the declaration enclosed in
Curly braces after the selector
What separates the CSS property and declaration
A colon
CSS Property: text-align
Indicate whether to centre the material or align it to the left or right
CSS Property: font-size
Sets the size of text
What is a CSS rule made up of
A selector and a semicolon-separated list of declarations inside brackets
What does each CSS declaration have
A property and a value separated by a colon
What are CSS type selectors
Selectors that match elements by their node name
What is a CSS declaration
The set of visual effects to be applied to a selector
What are CSS id selectors
Selectors that match elements based on their id attribute
What does a CSS id selector consist of
a hash character followed by the id
Where are CSS id selectors normally used
to pick out particular landmarks on a page
What are CSS class selectors
Selectors that match elements based on their class attribute
What does a CSS class selector consist of
a full stop (.) followed by the class name
What is the main benefit of a CSS class selector over an id selector
Multiple element can have the same class
What are CSS combinators
Selectors that allow more than one selector to be combined into a more complex rule
What do CSS descendant combinators consist of
A space between two selectors
What are CSS descendant combinators
Selectors that matches all elements that are descendants of a specified element
What do CSS child combinators consist of
A greater than bracket between two selectors
What are CSS descendant combinators
Selectors that allow you to select elements that are direct children of a parent
CSS Property: color
Sets the color of text
What notation can you use for CSS colours
keyword, rrggbb, rgb and rgb(r, g, b)
What do CSS length values consist of
a number followed by a unit
CSS Unit: px
Length in pixels which is determined by the monitors resolution
CSS Unit: pt
Length in point, a measure from typography that is equivalent to 1/72 of an inch
CSS Unit: cm
Length in centimetres
CSS Unit: in
Length in inches
CSS Unit: em
Length that is relative to the size of the current font
CSS Unit: %
Length as a proportion of the size of the element’s parent
CSS Property: border-width
sets the length of the border
CSS Property: border-style
Sets the style of the border
CSS Property: border-color
Sets the colour of the border
CSS Property: border
border is a shorthand property for setting the style, color and length of the border
CSS Property: background-color
Sets the background colour
CSS Property: background-image
Gives the background an image
CSS Property: background-repeat
Defines how background images are repeated
CSS Property: background-position
Sets the initial background position of the background image
CSS Property: background-attachment
Determines whether that image’s position is fixed within the viewport, or scrolls along with its containing block
CSS Property: padding
Sets the padding space on all sides of an element
CSS Property: padding-bottom
Sets the height of the padding area at the bottom of an element
CSS Property: padding-left
Sets the padding space required on the left side of an element
CSS Property: padding-right
Sets the padding space required on the right side of an element
CSS Property: padding-top
Sets the padding space required on the top of an element
CSS Property: margin
Sets the margin for all four sides
CSS Property: margin-bottom
Sets the margin space required on the bottom of an element
CSS Property: margin-left
Sets the margin space required on the left side of an element
CSS Property: margin-right
Sets the margin space required on the right side of an element
CSS Property: margin-top
Sets the margin space required on the top of an element
CSS Property: display
Specifies the type of rendering box used for an element.
What two CSS properties do floats rely on
float and clear
CSS Property: float
Determines which side the elements floats to
CSS Property: clear
Determines how the element behaves with respect to other floated elements
What values does the CSS property float take
left, right and none
What values does the CSS Property clear take
left, right, both and none