Design comparison
Community feedback
- @correlucasPosted about 2 years ago
πΎHello @Zsollt88, congratulations for your new solution!
Your component is perfect, but is not responsive yet, this is due the
fixed width
you've applied to the container.The main difference between
width
andmax-width
is that the first property is fixed and the second isflexible
, for example, a component withwidth: 340px
will not grow or contract because the size will be ever the same, but a container withmax-width: 340px
ormin-width: 320px
can grow or contract depending of the property you've set for the container. So if you want a responsive block element, never usewidth
choose ormin-width
ormax-width
.} #previewCard { max-width: 300px; height: 500px; background-color: hsl(216, 50%, 16%); font-family: 'Outfit', sans-serif; color: hsl(0, 0%, 100%); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 25px; border-radius: 25px; }
π I hope this helps you and happy coding!
Marked as helpful1
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