Design comparison
SolutionDesign
Community feedback
- @kaamiikPosted 3 days ago
There are some important issues in your code specially your CSS I wanna mention:
- Try to use a proper CSS reset at the start of your CSS style. Andy Bell and Josh Comeau both have a good one. You can simply search on the internet to find them.
- Use
min-height: 100vh;
instead ofheight:100vh;
.height: 100vh
strictly limits the height to the viewport size, potentially causing overflow issues if the content is larger than the viewport. On the other hand,min-height: 100vh
allows your element to grow in height if the content exceeds the viewport size.
- Never limit your width and height in a container or element or tag that contains text inside.
When you limit the width and height of elements containing text, you risk the text being cut off,
overflowing, or becoming unreadable, especially on smaller screens or when the text dynamically changes.
It's generally better to allow the container to adjust its size based on its content or set a flexible
size that can adapt to different screen sizes and text lengths. You only need
max-width
here (and no need for width and height) because it prevents elements from stretching beyond a certain point, keeping them visually appealing across different screen sizes. It ensures your design remains adaptive and doesn't get too wide on larger screens.
position: absolute;
is completely wrong here. no need to use it.
- Your
font-size
andmax-width
should be inrem
unit notpx
. You can read this article about it and why you should not usepx
as a font-size.
- No need to have media query for this challenge and always try to code mobile first.
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord