@a-costas
Posted
Hi there! Nice job on completing the challenge!
Your use of semantic HTML is good! Nice job there!
As far as understanding when to use px
or %
, the answer you're looking for may be that you don't need either as often as you may think you do. Generally, you should avoid setting heights (and widths) at all in your code. Whether you're using pixels or percentages, setting heights should seldom be necessary. Using the display
property would help you a lot as it will keep you from needing to set deliberate heights for everything. You can use display
to your advantage! display: flex
for example, would cause your containers to grow as much as necessary to contain the content within them, then you can play around with paddings and margins to add more space in between, making it unnecessary for you to define heights or widths.
On a related but slightly different note, you should try using rem
units as much as possible, not just for fonts, but for nearly everything (margins, padding, etc). Here's a video that might be helpful! Are you using the right CSS units
Hope that's helpful. Nice job and happy coding!
Marked as helpful