Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Article Preview Component

BK Madsen 60

@MadsenBK

Desktop design screenshot for the Article preview component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

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

Josh 1,070

@josh76543210

Posted

Hello @MadsenBK,

Here is a solution to displaying the image:

  1. Wrap the <img> with <div> tags in the html.
  2. 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 helpful

1

BK Madsen 60

@MadsenBK

Posted

@josh76543210 That worked out perfectly. Thank you!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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