Design comparison
Solution retrospective
Nothing really
What challenges did you encounter, and how did you overcome them?I have issues doing the hovering of the equilibrium image and still haven't found a solution for it yet.
What specific areas of your project would you like help with?The hovering part of the equilibrium image
Community feedback
- @R3ygoskiPosted 7 months ago
Hello Samuel, your project is looking great, congratulations! The whitish shadow adds an interesting touch compared to black. Well done.
To center your card in the middle, consider adding this snippet to your
body
:height: 100vh; align-items: center;
This way, the
body
will occupy the entire vertical screen space and will center your card instead of stretching it out.Regarding the
hover
part, you can add a<div>
for that. You'll need to place the image and the<div>
within the same container, then use that container asposition: relative
, and the overlay asposition: absolute
. Then, you can apply the styling.Once again, congratulations! If you have any questions, please feel free to comment below, and I'll do my best to assist you.
Marked as helpful0@Sylvester009Posted 7 months ago@R3ygoski, Thank you for your help. My card is now perfectly centered but please can you explain more about the hover, positioning part.
0@R3ygoskiPosted 7 months agoHello @Sylvester009, of course, I think my explanation was unclear because I didn't provide an example, here's one (So you can better visualize, copy the snippets and place them in your HTML and CSS respectively): HTML:
Note: This snippet should replace you current:
<img src="images/image-equilibrium.jpg" alt="Equilibrium" class="image" />
<figure class="image-container"> <img src="images/image-equilibrium.jpg" alt="Equilibrium" class="image" /> <div class="overlay"> <img class="icon-view" src="images/icon-view.svg" alt=""> </div> </figure>
CSS:
.image-container { position: relative; } .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 10px; transition: .3s; cursor: pointer; } .overlay:hover { background: hsla(178, 100%, 50%, 0.5); } .overlay:hover .icon-view { opacity: 1; } .icon-view { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 4rem; opacity: 0; }
I hope this can be of great help. If you have any questions, you know what to do, just comment below, and I'll try to help as best as I can.
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