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 card component

Sefiane Ouberkaβ€’ 60

@sefianeouberka

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


all feedback is welcome thank you

Community feedback

Daniel πŸ›Έβ€’ 44,230

@danielmrz-dev

Posted

Hello @sefianeouberka!

Your solution looks great!

I have a couple of suggestions for improvement:

  • First: In order to make your HTML code more semantic, don't skip heading levels - start with <h1>, then use <h2>, and so on.. Unlike what most people think, it's not just about the size and weight of the text.

πŸ“Œ The <h1> to <h6> tags are used to define HTML headings.

πŸ“Œ <h1> defines the most important heading.

πŸ“Œ <h6> defines the least important heading.

πŸ“Œ Only use one <h1> per page - this should represent the main heading/title for the whole page.

  • Second: Still about semantic HTML, use <main> to wrap the main content instead of <div>.

All these tag changes may have little or no visual impact but they make your HTML code more semantic and improve SEO optimization as well as the accessibility of your project.

I hope it helps!

Other than that, great job!

Marked as helpful

0
Hugo Sanchezβ€’ 270

@HunigoleSan

Posted

Hello @aykinsancakli! πŸ‘‹

I want to commend you for your outstanding work, which closely aligns with the challenge requirements. Allow me to offer a suggestion that could enhance your CSS approach. πŸ› οΈ Upon reviewing your code snippet:

.btn:hover { 
    background: var(--color)
}

It's evident that you effectively utilize the hover pseudo-class, particularly suited for PC devices. However, it's crucial to acknowledge potential issues on mobile devices where hover behaves differently, often leading to unexpected outcomes. πŸ“± To address this, I recommend deactivating hover for mobile devices and utilizing the active pseudo-class instead. πŸ”

@media (max-width: 414px) { 
    .btn:hover { 
        background: none; /* Define the desired background for the button in its normal state */ 
    }
    /* Mobile styles */
    .btn:active { 
        background: var(--color)
    } 
}

You have the flexibility to employ this approach or explore alternative methods that better suit your preferences. The key takeaway is to gain insights into the nuances we must consider to refine our coding practices. πŸ› οΈπŸ“˜

Marked as helpful

0

Sefiane Ouberkaβ€’ 60

@sefianeouberka

Posted

@HunigoleSan thank you broo

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