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

Flexbox page

@oc-garcia

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Can someone help me to make my images stay hidden after the card boundaries?

Community feedback

@amalkarim

Posted

Hi Octávio,

Generally, you will need the image parent's element of the image has this property overflow: hidden;. But in this challenge, it's quite tricky. Because there are two images that shouldn't go beyond card boundaries, and there is an image that should go beyond boundaries (the red box image).

To make this work, we need to create an element inside <section class="faq__container-destop"> that has position: absolute; and the same width and height as .faq__container-desktop itself, but with overflow: hidden;, then we place two images inside it. And we place the red box image outside it to let it go beyond the boundaries. Don't forget to give .faq__container-desktop position: relative;

If you still have any problem, feel free to reply this comment

Marked as helpful

1

@oc-garcia

Posted

@amalkarim thanks Amal! I created a overflow-container inside the faq__header but the desktop and shadow image desappeared behind the card. Not sure what I am doing wrong. If you could take a second look it would be amazing.

0
Ali Ahmed 680

@Dany-GitHub

Posted

@oc-garcia I checked your solution the issue is coming from width and height you need to give .faq__header and overflow container as well then modify the left and tap for each image

0

@amalkarim

Posted

@oc-garcia

Place .overflow-container outside .faq__header. Like this:

<section class="faq__container-destop">
    <div class="overflow-container">
        ....
    </div>
    <div class="faq__header">
        ....
    </div>
    ...
</div>

Then give it full width and height of its parent (.faq__container-destop)

overflow-container {
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

After that:

  • You will need to adjust the position of two images inside .overflow-container.
  • And give faq__photo-box bigger z-index than .overflow-container. Or, maybe just remove z-index property from .overflow-container because I think it's unnecessary.
0
Ali Ahmed 680

@Dany-GitHub

Posted

You can set the overflow to hidden like that overflow: hidden; for more info you can see the documents MDN

2

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