Design comparison
SolutionDesign
Solution retrospective
Can any one advise how the main image (of the dresser) is done in the original? It seems to be streteched out and poistioned diffrently but Im unable to figure out/find how I could match this. Thanks!
Community feedback
- @josh76543210Posted over 1 year ago
Hello @MadsenBK,
Here is a solution to displaying the image:
- Wrap the
<img>
with<div>
tags in the html. - Set the height and width of the container and then set the image to 100% height of the container. The
overflow: hidden
property will prevent the part of the image that is outside the container from being displayed.
<div class="card-img-container"> <img src="images/drawers.jpg" alt="Green cabinet with drawers" class="card-img" /> </div>
.card-img-container { height: 32rem; width: 32.5rem; overflow: hidden; } .card-img { height: 100%; width: auto; }
Check out my solution here if you want to see how I used this.
Hope this helps. Happy Coding!
Marked as helpful1 - Wrap the
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