Section 9 - Flexbox Flashcards
When should you only use a table element?
when you’re trying to actually create a table
When should you not use the table element?
to layout the styling of your website
position: ____ takes blocks out of the normal flow of HTML and has them floating above the other content
position: absolute
How to use float correctly?
when you want to float an image to the left or right of a block of text to wrap the text around it
(do not use for layout)
In summary, how do you use Flexbox?
You drop your divs inside a container and then target that container in your CSS and set the display to “flex”
display: flex is a part of the display: inline, block, inline-block, none system. T or F?
False
display: flex is its own, completely different system with a different set of rules
Different elements by default will have ______
different elements by default will have different display values
By default, what display value does a div have?
it’s going to be a full-width block by default (across the entire page)
By default, what display value does span have?
by default it’s going to be an inline element
What happens to default display values when you enclose all of th elements you want to display inside a flexible container?
the default display values get ignored/overridden and Flexbox will lay everything out
The width of each of the elements inside the Flexbox will normally be based on the ___ ___
content size
(when overriding default display values for elements inside a container)
When using gap, how do you make the gap static and more responsive? (2)
static example - gap: ##px
responsive example - gap: #rem
What does rem mean again?
rem is a unit that is going to adapt based on the top-level size of your content
(is responsive)
What happens when you set a container to display: inline-flex?
Similar to inline-block, it allows the Flexbox to occupy as much space as it needs but it means that other things can also go on the same line
What are the 2 versions of creating a flexbox container that we learned?
display: flex
display: inline-flex
Does a flexbox container need to contain all divs?
No! It can contain whatever element you want to flex such as list items to create a horizontal nav bar
How do you get rid of bullet points in a list?
add list-style: none to a li element selector section
li {
list-style: none;
}
What are 2 ways to add numbers to a box model?
- px
- %
How do you indicate that there are multiple words when using a font-family name
use quotation marks around the name
ex: font-family: “Times New Roman”, serif
Is the table element still used in modern web design?
Yes, but only used when you’re actually trying to create a table not use it for positioning (like to show your sales, visitor counts, etc)
What method replaced the table property in terms of web page layout?
the display property
What are the 4 options for the display property?
- display: inline
- display: block
- display: inline-block
- display: none
Can you set the width/height with display: inline?
No, it defaults to the size of their content (HTML)
Can you set the width/height with display: inline-block?
Yes, and the elements can go inline with each other as well