Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

3 column preview card component main html css

GiovanniPereira05•70
@GiovanniPereira05
A solution to the 3-column preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Any feedback is welcome but especially help about mobile border-radius I didn't know how to do it

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Melvin Aguilar 🧑🏻‍💻•61,020
    @MelvinAguilar
    Posted over 1 year ago

    Hello there 👋. Good job on completing the challenge !

    I have some suggestions about your code that might interest you.

    CSS 🎨:

    • You don't necessarily need to add border--radius to every column Instead, you can use set to the container parent and use overflow: hidden on the container to clip any excess from the image, achieving a similar effect.
    container {
      border-radius: 15px;
      overflow: hidden;
    }
    

    HTML 🏷️:

    • You should use the <a> tag instead of the <button> tag because the Learn More button is a link to another page. Use buttons to perform actions like submitting a form or closing a modal and use links to navigate to another page. You can read more about this here 📘.
    • Not all images should have alt text. Car icons are for decoration purposes only, so they can be hidden from screen-readers by leaving its alt attribute empty. You can read more about this here 📘.

    I hope you find it useful! 😄 Above all, the solution you submitted is great!

    Happy coding!

    Marked as helpful
  • P
    Daniel 🛸•44,810
    @danielmrz-dev
    Posted over 1 year ago

    Hello @GiovanniPereira05!

    You did a very good job there!

    I have just one suggestion for improvement:

    • Since the button Learn more is a clickable element, it's nice to add cursor: pointer to it in addition to the background color shift hover effect.

    Other than that, you did a great job!

    Also, are you brazilian? Just asking because your name is pretty common here, and if you are, I can comment in portuguese 😊

    Marked as helpful
  • Neto Leutwiler•90
    @ntwiler
    Posted over 1 year ago

    Hello Giovanni, I took a look at the code and it seems to be correct, you did it! Regarding border radious on mobile, the only thing you need to do is add these new codes within the mobile field, as if you were writing new code, understand?

    In your example it would be something more or less like this:

    @media screen and (max-width: 767px) {
    
         .container {
             flex-direction: column;
             align-items: center;
         }
    
        #q1{
         border-radius: "your new values here";
        }
    
        #q2{
         border-radius: "your new values here";
        }
    
        #q3{
         border-radius: "your new values here";
        }
    }
    

    I would also add a top and bottom margin to the mobile container to suit the project.

    I hope I helped and didn't bother you rsrs

    Marked as helpful
  • Jax Teller•670
    @piushbhandari
    Posted over 1 year ago

    for border-radius, you can set it like this: border-radius: 10px 11px 12px 13px; top left, top right, bottom right, bottom left in that order

    FYI: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius

    so in your code for mobile, you can set the first card to be, for example, border-radius: 5px 5px 0 0;, border-radius: 0; for the middle one, then border-radius: 0 0 5px 5px for the last one

    Marked as helpful

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