Manuel Brás
@ManuelMadeira98All comments
- @GastonfauretSubmitted almost 2 years ago@ManuelMadeira98Posted almost 2 years ago
Hey!
I had a quick glance at your solution and I have a couple suggestions:
- Instead of adding a margin top your
main
element, an easier and cleaner way to center the content would be using grid or flexbox. For example, adding:
// Allow percentage-based heights in the application. Always use this reset. html, body { height: 100%; } body { display: grid; place-items: center; }
centers your content vertically and horizontally on the page. The
place-items
property works as a shorthand foralign-items
andjustify-content
.-
I noticed you are explicitly setting the size for each card, I think a better approach would be to wrap the cards with a container (don't do it with
main
element) and amax-width
. This way, this container would evenly control how much the cards could stretch horizontally. Generally speaking, usemax-width
andmax-height
on your elements — as opposed towidth
andheight
— as they are more appropriate properties when dealing with responsive layouts. -
There's no need to use
h2
withbr
elements for the content of the card. Instead, prefer a paragraph element. It is a block level element by default and it will naturally horizontally fill your card. Generally speaking, always try to avoid usingbr
elements on your layouts.
Otherwise it's looking good!
Happy coding! :)
0 - Instead of adding a margin top your
- @mallory-cvlhSubmitted almost 2 years ago@ManuelMadeira98Posted almost 2 years ago
An easy way to center the card would be using grid or flexbox. For example, adding:
body { display: grid; place-items: center; }
centers your card vertically and horizontally on the page, since
place-items
works as a shorthand foralign-items
andjustify-content
.Happy coding :)
2