Not Found
Not Found
Failed to decode param 'kaan%F6zdemir'
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 with HTML CSS FLEXBOX

#cube-css#materialize-css#tailwind-css#workbox#sass/scss
Rain-Riot 50

@rain-riot

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View Challenge

Design Comparison

SolutionDesign

Report

2

Accessibility Issues

1

HTML Issues

View Report

Rain-Riot’s questions for the community

I'm still learning and continue my new journey in this world. I'd love to hear your feedback! Thanks, cheers!

Community Feedback

@vcarames

Posted

Hey @rain-riot, some suggestions to improve you code:

  • Your not using the Alt Tag effectively, This is image isn't decorative, it serves purpose. The Alt Tag should not be blank it needs to have some content in it. You want to describe what the image is; they need to be readable. Assume you’re describing the image/icon to someone.

  • The old price isnt being announce properly to screenreaders. You want to wrap it in a Del Element and include a sr-only text explaining that this is the old price.

  • Your CSS Resets are extremely bare, you want to add more to them. Here are few CSS Resets that you can look at and use to create your own CSS Reset or just copy and paste one that already prebuilt.

https://www.joshwcomeau.com/css/custom-css-reset/

https://meyerweb.com/eric/tools/css/reset/

http://html5doctor.com/html-5-reset-stylesheet/

  • To keep your CSS code organized and easier to use, I suggest implementing CSS Variables. This will come in handy when building large websites, using light/dark mode, etc…

More Info

https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties

https://www.w3schools.com/css/css3_variables.asp

Happy Coding!

Marked as helpful

0


Rain-Riot 50

@rain-riot

Posted

@vcarames thanks for the feedback, really appreciate that.

0

P
Lucas 👾 84,530

@correlucas

Posted

👾Hello Rain-Riot, Congratulations on completing this challenge!

Your solution its almost done and I’ve some tips to help you to improve it:

You did a good work putting everything together in this challenge, something you can do to improve the image that needs to change between mobile and desktop is to use <picture> instead of <img> wrapped in a div. You can manage both images inside the <picture> tag and use the html to code to set when the images should change setting the device max-width depending of the device (phone / computer) Here’s a guide about how to use picture: https://www.w3schools.com/tags/tag_picture.asp

See the example below:

<picture>
  <source media="(max-width:650px)" srcset="./images/image-product-mobile.jpg">
  <img src="./images/image-product-desktop.jpg" alt="Gabrielle Parfum" style="width:auto;">
</picture>

✌️ I hope this helps you and happy coding!

Marked as helpful

0


Rain-Riot 50

@rain-riot

Posted

@correlucas Thanks again for the advice! Really appreciate that! Cheers.

0

Adriano 11,920

@AdrianoEscarabote

Posted

Hi Rain-Riot, how are you?

I really liked the result of your project, but I have some tips that I think you will like:

1- We have to make sure that all the content is contained in a reference region, designated with HTML5 reference elements or ARIA reference regions.

Example:

native HTML5 reference elements:

<body>
    <header>This is the header</header>
    <nav>This is the nav</nav>
    <main>This is the main</main>
    <footer>This is the footer</footer>
</body>

ARIA best practices call for using native HTML5 reference elements instead of ARIA functions whenever possible, but the markup in the following example works:

<body>
     <div role="banner">This is the header</div>
     <div role="navigation">This is the nav</div>
     <div role="main">This is the main</div>
     <div role="contentinfo">This is the footer</div>
</body>

It is a best practice to contain all content, except skip links, in distinct regions such as header, navigation, main, and footer.

Link to read more about: click here

2- Why it Matters

Navigating the web page is far simpler for screen reader users if all of the content splits between one or more high-level sections. Content outside of these sections is difficult to find, and its purpose may be unclear.

HTML has historically lacked some key semantic markers, such as the ability to designate sections of the page as the header, navigation, main content, and footer. Using both HTML5 elements and ARIA landmarks in the same element is considered a best practice, but the future will favor HTML regions as browser support increases.

Rule Description

It is a best practice to ensure that there is only one main landmark to navigate to the primary content of the page and that if the page contains iframe elements, each should either contain no landmarks, or just a single landmark.

Link to read more about: click here

Prefer to use rem over px to have your page working better across browsers and resizing the elements properly

The rest is great!!

Hope it helps...👍

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Slack logo

Join our Slack community

Join over 100,000 people taking the challenges, talking about their code, helping each other, and chatting about all things front-end!