CSS Flashcards
What is the CSS box model?
The CSS box model is essentially a box that wraps around every HTML element.
What does the CSS box model consists of?
- Content
- Padding
- Border
- Margin
Describe the content portion of the CSS box model.
The content of the box, where text and images appear
Describe the padding portion of the CSS box model.
Clears an area around the content. The padding is transparent. Order of padding is as follows: top, right, bottom, left (Clockwise).
Describe the border portion of the CSS box model.
A border that goes around the padding and content.
Describe the margin portion of the CSS box model.
Clears an area outside the border. The margin is transparent.
Describe the overflow property.
The overflow property specifies what should happen if content overflows an element’s box.
This property specifies whether to clip content or to add scrollbars when an element’s content is too big to fit in a specified area.
Note: The overflow property only works for block elements with a specified height.
What are selectors in CSS?
In CSS, selectors are patterns used to select element(s) you want to style.
What are some examples of selectors in CSS?
- Class selector (.class)
- Id selector (#id)
- Star selector (*)
- Attribute selector ([attribute])
What does the class selector in CSS do?
The class selector in CSS selects all elements with class.
What does the id selector in CSS do?
The id selector in CSS selects all elements with id.
What does the star selector in CSS do?
The star selector selects all elements.
What does the attribute selector in CSS do?
The attribute selector selects all elements with a target attribute.
What is border-style in CSS?
The border style property allows you to change the style of your border. An example of this could be dashed, which would set your border to a series of dashes.
Describe display overflow in CSS
The overflow property specifies what should happen if content overflows an element’s box.