Troubleshooting, Centering, Positioning Flashcards
List two ways you can troubleshoot inline elements that run together.
- You use the line-height property of the inline container of the inline element and give it a value.
- You change the display from inline to inline-block or block and give it a margin top property value.
How do you center inline elements horizontally?
You give the parent block element that contains the inline element a text-align property value of center.
How do you center inline elements vertically?
You use the vertical align property on the inline element.
Note that this may or may not work.
How do you center a block element horizontally?
You may give the block element a width and set the left and right margins to auto or set the margins to auto.
How do you center block elements vertically?
There is no straight forward way to center block elements vertically.
The best way is to use flexbox.
Define a positioned element.
A positioned element is one that has had its position property changed from its default values.
Define the CSS position property.
The CSS position property governs how elements in a page are positioned and how they respond to the position adjusting values of top, right, bottom, and left.
List all the CSS position property values.
- Static (The default)
- Fixed
- Relative
- Absolute
Flexbox reduces the use case of what CSS position property values?
Relative and absolute
List all the characteristics you know of the CSS position value of static ( static elements).
- It is the default for all elements.
- Static elements follow the “flowing text” model of layout.
- Static elements completely ignore the positioning adjusting properties of top, right, bottom and left.
- The properties that influence static elements are:
a) margins
b) paddings
c) floats
d) The display property values of block, inline, inline-block, etc