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

Basic Product preview card component

Diego 20

@taldr27

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


Hello, I have a question:

  • How can I put the footer correctly on the page? I tried with absolute, but when the size changes, the footer overlaps. Thank you

Community feedback

@VCarames

Posted

Hey there! 👋 Here are some suggestions to help improve your code:

  • The Alt Tag Description for the image needs to be improved upon. You want to describe what the image is; they need to be readable. Assume you’re describing the image to someone.

  • This challenges requires the use of two images 🎑 for different breakpoints. The Picture Element will facilitate this.

Here is an example of how it works: EXAMPLE

Syntax:

  <picture>
    <source media="(min-width: )" srcset="">
    <img src="" alt="">
  </picture>

More Info:

https://www.w3schools.com/html/html_images_picture.asp

https://web.dev/learn/design/picture-element/

  • The old price 🏷 is not being announced properly to screen readers. You want to wrap it in a Del Element and include span element with an sr-only text explaining that this is the old price.

If you have any questions or need further clarification, let me know.

Happy Coding! 👻🎃

Marked as helpful

2

@mdabdulrahman

Posted

Hey @taldr27,

Your Solution is really good!

1.Use atleast one <h1> tag so you couldn't get the warning.

Marked as helpful

1
PhoenixDev22 16,950

@PhoenixDev22

Posted

Hi Diego,

Congratulation on completing anther frontend mentor challenge.

Excellent work! You already received some helpful feedback which is nice to see , just going to add some suggestions as well and don't mind if I re-iterate some ideas mentioned already

  • It's not recommended to capitalize in html, let css text transform take care of that. Remember screen readers won't be able to Read capitalized text as they will often read them letter by letter thinking they are acronyms.
  • In HTML, the <del> tag is used to identify text that has been deleted from a document but retained to show the history of modifications made to the document. Strike through is a CSS property and does not carry any semantic meaning as inserted or deleted for screen readers. For screen reader: <del>deleted indicates text removed. In this instance, the two prices are read out which can be confusing.
  • You should use object-fit: cover; to the image which sets how the image should be resized to fit its container. object-fit: cover; maintains its aspect ratio while filling the element's entire content box.
  • Add border-radius and overflow hidden to the main container that wraps the two halves so you don't have to setborder-radiusto individual corners.
  • Remember a modern css reset on every project that make all browsers display elements the same.
  • Adding rel="noopener" or rel="noreferrer" totarget="_blank"links. When you link to a page on another site using target=”_blank” attribute, you can expose your site to performance and security issues.

Overall, great work! hopefully this feedback helps.

1
Petabyte 190

@peta-8-bit

Posted

Regarding the footer position, you can use position:fixed and set text align, bottom,left and right properties.

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