@Islandstone89
Posted
Hi, well done for figuring out about the min-height
! You have done a decent job here :)
Some tips to improve your solution even further:
HTML:
-
Remove
<section>
, it is not needed. -
I would change the heading to a
<h2>
- a page should only have one<h1>
, reserved for the main heading. As this is a card heading, it would likely not be the main heading on a page with several components.
CSS:
-
Including a CSS Reset at the top is good practice.
-
You don't need to set anything on
html
, so I would remove that selector. -
Whenever the value is zero, you don't need to include the unit, so
margin: 0px
is usually written asmargin: 0
. -
I recommend adding
1rem
ofpadding
on thebody
, to ensure the card doesn't touch the edges on small screens. -
Move
background-color
andborder-radius
from<section>
to.qr_container
. -
Remove all widths and heights in
px
and%
. You should never set a fixed height inpx
, especially not on text elements: if the text grows taller than the set size, it will cause overflow. -
Add a
max-width
of around20rem
on the card, to prevent it from getting too wide on larger screens. -
Since you're already using Flexbox on the card, I would add
gap: 10px
to create consistent spacing between the card elements. This is more efficient than settingpadding-top: 10px
on both the heading and the paragraph, so remove those. -
font-size
must never be in px. This is a big accessibility issue, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. -
Paragraphs have a default value of
font-weight: 400
, so there is no need to declare it. -
Since all of the text should be centered, you only need to set
text-align: center
on the body, and remove it elsewhere. The children will inherit the value. -
For the same reason, I would set
font-family
on thebody
, and remove it elsewhere. -
On the image, add
display: block
andmax-width: 100%
- the max-width prevents it from overflowing its container. Without this, an image would overflow if its intrinsic size is wider than the container.max-width: 100%
makes the image shrink to fit inside its container. -
Finally, I would increase the
padding
on the card to around16px
.
Marked as helpful