Design comparison
Solution retrospective
i cant make 169 in center corresponding to 149
Community feedback
- @jakegodsallPosted about 2 years ago
This could be achieved by creating an outer div for the two prices, and using flexbox display property as follows:
<div class="prices"> <h1 class="price"> $149.99</h1> <h5 class="price"> $169.99</h5> </div>
.prices { display: flex; align-items: center; }
If you would like to learn more about flexbox, I would highly recommend Flexbox zombies https://geddski.teachable.com/p/flexbox-zombies I learned everything I know about flexbox from playing this game.
Hope this helps
Marked as helpful1 - @correlucasPosted about 2 years ago
👾Hi Mohit, congratulations for your first solution!👋 Welcome to the Frontend Mentor Coding Community!
Great start and great first solution! You’ve done really good work here putting everything together, I’ve some suggestions you can consider applying to your code:
1.Use
<main>
instead of<div>
to wrap the card container. This way you show that this is the main block of content and also replace the div with a semantic tag.2.Use the tag
<picture>
to wrap the product image inside the html instead of using it as<img>
orbackground-image
(with the css). Using<picture>
you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isn’t a better practice import this product image with CSS since this will make it harder to the image.3.Fix the component responsiveness, its not working yet and this is due the
fixed width
you've applied to the container. The difference betweenwidth
andmax-width
is that the first(width) is fixed and the second(max-width) isflexible
and make the element shrink when the screen starts to scale down. So if you want a responsive block element, never usewidth
choose ormin-width
ormax-width
.✌️ 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