Inline-Block Elements
Sometimes we want the best of both: elements that line up in a row like inline elements, but that we can size like blocks. That is what the value inline-block does. On the outside, such an element behaves like an inline one: it sits in a line next to other elements, and when there's no room left in the line, it moves to the next one. On the inside, it's a block: width, height, padding and all margins work on it.
Buttons (button) are inline-block by default. That is why they can stand in a row next to each other, and we can still set their size.
The breeds at the bottom of the page are styled as cards with a width, padding and a border. As list items, though, they are stacked below each other. Let's put them in a row.
Instructions
- 1
In the rule for
#breeds li, adddisplay: inline-block. The cards line up in a row and keep their width, padding and border. (Withinline, their width would be ignored.) - 2
Inline-block elements are placed in a line like words, so we can align them like text. In the rule for
#breeds ul, addtext-align: center. The cards move to the middle of the page.