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

html css grid

Descifle 110

@descifle

Desktop design screenshot for the Four card feature section coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I have an issue with getting the cards to shrink and stay within the viewport

Community feedback

Alex 1,090

@AlexBueckig

Posted

Hi @descifle,

your card aren't shrinking because your .card has a fixed width set. If you want them to shrink try max-width instead of width. max-width allows them to scale down if they don't have enough room left to span the whole width.

1

@sarah27h

Posted

@descifle Thanks for your feedback, I decided to use JS to create HTML for cards because the code of card is repeated. And when Matt reviewed my challenge he told me that it’s a bad practice in this instance for those reasons.

  • Injecting the content using JS will hurt your SEO.
  • Users who disable JS won’t be able to view the content.
  • The site will load slower.
  • Use HTML, CSS and a little bit of JS for form validation for simple landing pages.
  • Use more JS when building larger-scale applications. He gives the Frontend Mentor platform as an example for larger-scale applications, he used React and used NextJS to make use of server-side rendering so that the SEO for the site doesn’t take a hit.

So I need to refactor it again :) and use HTML and CSS.

1

@sarah27h

Posted

Great job @descifle, your design is responsive for all sizes. I recommend to

  • Add margin top and bottom to the main element and remove padding-top: 4rem;.
0
Descifle 110

@descifle

Posted

@sarah27h Thank you! I looked at yours and it's very responsive as well. I'm just intrigued about the Javascript. I haven't learned Javascript yet. Can you tell me why you chose to use Javascript rather than CSS?

1

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