Design comparison
SolutionDesign
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there π. Congratulations on successfully completing the challenge! π
- I have other recommendations regarding your code that I believe will be of great interest to you.
COMPONENT MEASUREMENTS π:
- Use
min-height: 100vh
forbody
element instead ofheight: 100vh
. Setting theheight: 100vh
may result in the component being cut off on smaller screens.
- For example; if we set
height: 100vh
then thebody
will have100vh
height no matter what. Even if the content spans more than100vh
.
- But if we set
min-height: 100vh
then thebody
will start at100vh
, if the content pushes thebody
beyond100vh
it will continue growing. However if you have content that takes less than100vh
it will still take100vh
in space.
.
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
0 - @shakhboz-shukhratPosted over 1 year ago
Hello thereπ! Congratulations on completing this challenge! There do not seem to be any problems with the code. However, here it is formatted for better readability:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png" /> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous" /> <title>Frontend Mentor | Product preview card component</title> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Fraunces:wght@700&family=Montserrat:wght@500;700&display=swap" rel="stylesheet" /> <link rel="stylesheet" href="style.css" /> </head> <body> <div class="container d-flex justify-content-center align-items-center flex-column" > <div class="row"> <div class="col"> <div class="card" style="max-width: 540px\">\n <div class="row g-0"> <div class="col-md-6"> <img src="./images/image-product-desktop.jpg" class="img-fluid rounded-start" alt="..." /> </div> <div class="col-md-6"> <div class="card-body d-flex align-content-between flex-column"> <p class="card-text text-uppercase opacity-50"> p e r f u m e </p> <h3 class="card-title">Gabrielle Essence Eau De Parfum</h3> <p class="card-text opacity-50"> A floral, solar and voluptuous interpretation composed by Olivier Polge, Perfumer-Creator for the House of CHANEL. </p> <div class="row mb-3"> <div class="col-auto"> <p class="h3">$149.99</p> </div> <div class="col-auto"> <p class="small text-decoration-line-through opacity-50"> $169.99 </p> </div> </div> <div class="row px-3"> <a class="card-link btn"> <svg class="me-3" width="15" height="16" xmlns="http://www.w3.org/2000/svg" > <path d="M14.383 10.388a2.397 2.397 0 0 0-1.518-2.222l1.494-5.593a.8.8 0 0 0-.144-.695.8.8 0 0 0-.631-.28H2.637L2.373.591A.8.8 0 0 0 1.598 0H0v1.598h.983l1.982 7.4a.8.8 0 0 0 .799.59h8.222a.8.8 0 0 1 0 1.599H1.598a.8.8 0 1 0 0 1.598h.943a2.397 2.397 0 1 0 4.507 0h1.885a2.397 2.397 0 1 0 4.331-.376 2.397 2.397 0 0 0 1.12-2.021ZM11.26 7.99H4.395L3.068 3.196h9.477L11.26 7.991Zm-6.465 6.392a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Zm6.393 0a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Z" fill="#FFF" /> </svg> Add to Chart </a> </div> </div> </div> </div> </div> </div> </div> <div class="attribution"> Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank" >Frontend Mentor</a >. Coded by <a href="#">mcurvay</a>. </div> </div> </body> </html>
Anyway, your solution is great. Hope you will find this helpful. Happy coding!
0
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