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

Product Review Card design implemented with CSS Flexbox and patience

@Cre8steveDev

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello! Thank you for checking out my submission. Please I'll appreciate your feedback on my code on how best to optimize it for more efficiency and accessibility. Thank you very much.

I'll like if you could check out my step in fitting the perfume image within the left side box (desktop version); the image was not fully covering the div it was in, i had to use the translate:scale() property to 'force' it.

Also, can you please explain how one can use paths; I was trying to link my image via css using images/image-name.jpg; but it didn't work, so I had to move the image into the css folder itself and used (image-name.jpg) and this worked.

Community feedback

Account Deleted

Hi Stephen! Good job on getting really close to the design!

Regarding your issue with the image URL, when we write a URL in the css file, that URL is relative to where the css file is located. So when you say "images/image-name.jpg" what it's actually looking in is "css/images/image-name.jpg". To target the actual images folder, you first need to go up to the parent folder, which you can do by using a double period. So it would look like "../images/image-name.jpg".

As for the positioning of the image, I found it easier to simply use a div with a background image applied to it, which allowed me to use the background position and size properties:

.preview-img {
	background-image: url(./images/image-product-desktop.jpg);
	height: 100%;
	background-position: center;
	background-size: cover;
}

For accessibility purposes, I added an aria-label to the div:

<div
	class="preview-img"
	role="img"
	aria-label="Bottle of Gabrielle Essence Eau De Parfum"
></div>

Check out my solution if you want to have a deeper look.You should also work though the HTML Validation Report to fix any errors with your markup.

Hope this helps :)

Marked as helpful

1

@Cre8steveDev

Posted

@seanv96 Thank you so much for your detailed response... I'll look up your solution and try to implement.. Thanks alot for the tip about using background image 💯

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