CSS Flashcards
(24 cards)
What are the names of the individual pieces of a CSS rule?
CSS selector, declaration block, property and value
In CSS, how do you select elements by their class attribute?
(Dot).class-name
ie .class-name {
In CSS, how do you select elements by their type?
By the <p> contents of the appropriate html container / tag = p {
</p>
In CSS, how do you select an element by its id attribute?
hashtag # appropriate ID name from the index.html doc #id_name {
Name three different types of values you can use to specify colors in CSS.
keywords, hexadecimal , RBG
What CSS properties make up the box model?
margins, borders, padding
Which CSS property pushes boxes away from each other?
margin
Which CSS property add space between a box’s content and its border?
padding
What is a pseudo-class?
is a selector the selects a element that are in a specific state(special state)
What are CSS pseudo-classes useful for?
writing less code and to simplify
Name at least two units of type size in CSS.
px = pixel
rem = relative to root element
% =percentage
What CSS property controls the font used for the text inside an element?
font-family
What is the default flex-direction of a flex container?
Row
What is the default flex-wrap of a flex container?
Nowrap
What is the default value for the position property of HTML elements?
Static
What are the four box offset properties?
Left, right, bottom and top
What is the default flex-wrap of a flex container?
no-wrap
What is the default value for the position property of HTML elements?
static
How does setting position: relative on an element affect document flow?
Maintains normal document flow, but it’s final postion can now be adjusted.
How does setting position: relative on an element affect where it appears on the page?
it will have no effect on it’s positioning at all, it will be exactly as it would be if you left it as position: static;
How does setting position: absolute on an element affect document flow?
elements are removed from the flow of elements on the page. An element with this type of positioning is not affected by other elements and it doesn’t affect other elements.
How does setting position: absolute on an element affect where it appears on the page?
these values will be relative to the next parent element with relative (or absolute) positioning. If there is no such parent, it will default all the way back up to the element itself meaning it will be placed relative to the page itself. Its overuse or improper use can limit the flexibility of your site.
How do you constrain an absolutely positioned element to a containing block?
the containing block is formed by the edge of the padding box of the nearest ancestor element that has a position value other than static
Why do two div elements “vertically stack” on one another by default?
They are block elements