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 preview card component

@ahmed-mangood

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Hassia Issah 50,670

@Hassiai

Posted

Replace<div class="card">with the main tag and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html

To center .card on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.

Use rem or em as unit for the padding, margin, width and preferably rem for the font-size for more on CSS units Click here

Give .card the card a max-width value, instead giving the body a width value that is equal to screen-size that was specified in the styleguide.md

the desktop image is not visible because you forgot to add "./" in the beginning of the url value. url('./images/image-product-desktop.jpg') instead of url('images/image-product-desktop.jpg')

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

0
Waldo 250

@Waldo3333

Posted

I noticed you used the desktop image for the mobile background =

"@media max-width: 799px { .card .card-img { width: 340px; height: 472px; border-bottom-left-radius: 8px; background-image: url('images/image-product-desktop.jpg'); } }"

and the mobile image for the desktop size =

"<div class="card"> <img class="card-img" src="./images/image-product-mobile.jpg" alt="">

</div>"

may switching them could fix the image glitch :)

Marked as helpful

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