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

Responsive article preview component

Levis Kim 1,180

@Orekihotarou-k

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


What are you most proud of, and what would you do differently next time?

This is the second time I've done this particular challenge and I found the JS part of it so much easier than it at first.

What challenges did you encounter, and how did you overcome them?

I had an issue with getting the drawers image looking like it does in the design

What specific areas of your project would you like help with?

I need help with getting the drawers image to look like it does in the design

Community feedback

@Natty-tech

Posted

Hello !, so I see your drawer image takes up always takes up almost half of the class called "article-preview". If you want to make the image smaller than the text part you can give the parent element the grid display and give the image lower "grid-template-column" percentage like the one below:

//give article-preview grid display .articel-preview{ display: grid; grid-template-columns: 40% 60%; //this will make the image width smaller than the text }

you can change the percentage however you like till you get the desired result! Hope this helps!

0

Levis Kim 1,180

@Orekihotarou-k

Posted

Hi @Natty-tech. Thank you for taking the time to review my solution. I appreciate that a lot. I set the display: grid and the grid-template-columns: 40% 60% and I found that it does reduce the space that the image takes up.

These changes introduced a new issue however. The content of the second column overflows on top of the image. I think this is brought about by the image. Do you have any ideas on how this can be handled?

Thank you again for your time. Have a wonderful day/night✨

0

@Natty-tech

Posted

Hello @Orekihotarou-k, I see you are using flex properties on your text content article-preview--content class and sudden changes to its parent element ".article-preview" will affect your second column. I recommend the following steps: 1.) wrap the drawer image with a div element (lets call it imgwrapper) and also the text content with another div element (lets call it text wrapper)Dont forget to give the image inside the imgwrapper div a width and height of 100% 2.) wrap these div (imgwrapper and text wrapper) with another div element (lets say masterwrapper) and give this a display: grid and also the grid-template-columns: 40% 60% property.

I think this should help with the overflowing situation you are having.

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