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 Component

Abdallah Hamadaโ€ข 280

@AbdullahHamadax

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


What specific areas of your project would you like help with?

Anything, I'm open for improvements!. I struggle so much with making the text exactly how wrapped/aligned as in the design.

Community feedback

P
Koda๐Ÿ‘นโ€ข 3,810

@kodan96

Posted

hi there! ๐Ÿ‘‹

you can apply max-width in ch to your elements:

p {
  max-width: 25ch;
}

in this example all <p> elements will wrap to a new line after 25 characters, without causing word breaks, so entire words will wrap, like usually.

Hope this was helpful ๐Ÿ™

Good luck and happy coding! ๐Ÿ’ช

1

Abdallah Hamadaโ€ข 280

@AbdullahHamadax

Posted

@kodan96 Tysm! โค๏ธ

1
Daniel ๐Ÿ›ธโ€ข 44,230

@danielmrz-dev

Posted

Hello there!

Congrats on completing the challenge! โœ…

Your solution looks great!

I have a suggestion for improvement:

๐Ÿ“Œ Think about using <main> to wrap your main content instead of <div>.

Imagine <div> and <span> in HTML as basic containers. They're good for holding stuff, but they don't tell us much about what's inside or its purpose on the webpage.

This change might not have impact on how your page looks, but it'll make your HTML code clearer and help with SEO and accessibility.

Hope that's helpful!

Keep up the great work!

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