Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

Product preview card

EDOARDO PITACCIO•180
@EdoPito
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Could not round some of the corners, is it because the image is actually a background image that has no repeat and only covers 50% of the card?

Any other feedback is welcome!!!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Mishael•370
    @mishael-codes
    Posted over 2 years ago

    Hello Edoardo

    You did some great work on this project

    However, to make your site more accessible, try using the <main> tag for the <div> that has the class of "card".

    Also, you can use the <footer> tag on the <div> with a class of "attribution".

    If you do not want to do that, you can as well add a role attribute to the respective <div> tags For example:

    For the main content, do this: <div role="main" class="card">

    And for the footer, do this: <div role="contentinfo" class="attribution">

    To read more about the use and importance of semantic HTML and the role attribute, check these sites:-

    Semantic HTML - w3schools

    HTML Role Attribute Explained

    Once again, You did well on your project.

    Keep it up

    Marked as helpful
  • Jake Samuels•780
    @jake4369
    Posted over 2 years ago

    Hi, a great idea for responsive images is to use the <picture></picture> tag. You can specify multiple images inside one tag, set media queries inside the tag, and when you resize the browser, the correct image will render it's a really cool.

    w3Schools has some good information on how to use it, just be sure to set your images to "display: block" in the CSS else you get some weird behaviour but other than it's a great way to handle multiple images like in this challenge.

    https://www.w3schools.com/tags/tag_picture.asp

    Hope this helps ☺️

    Marked as helpful
  • Harun Korkmaz•40
    @Widded
    Posted over 2 years ago

    You can give flex to the body;

    body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

    So the content will be in the middle of the page

    also you can use border-top-left-radius / border-bottom-left-radius for image.

    Marked as helpful
  • Yohannes Teshome•140
    @tiobista
    Posted over 2 years ago

    I think you can put the image inside a div container and give the container a border radius... so that you can get the image with rounded corner

  • EDOARDO PITACCIO•180
    @EdoPito
    Posted over 2 years ago

    Just realised i havent used white for the card...

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub