Not Found
Not Found
Cannot read properties of null (reading 'code')
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Cannot read properties of null (reading 'code')
Not Found
Not Found
Not Found
Cannot read properties of null (reading 'code')
Not Found

Submitted

3-column preview card component

Kaung Lunā€¢ 110

@lunk-kml

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I think I make it look as close as possible. I still think my code is a little messy.

Feel free to review my code and preview the site. I welcome any feedbacks, tips, or ideas. I'm still learning.

!! Please let me know if my code is a mess or not lol

Community feedback

PhoenixDev22ā€¢ 16,990

@PhoenixDev22

Posted

Hi KL,

Congratulation on completing another frontend mentor challenge.

Great job! i have some suggestions regarding your solution:

  • You should use <main> landmark for the main body content and<footer> for the attribution as HTML5 landmark elements are used to improve navigation experience on your site for users of assistive technology.
  • About <h1>it is recommended not to have more than one h1 on the page. Multiple <h1>tags make using screen readers more difficult, decreasing your siteā€™s accessibility. In this challenge, as itā€™s not a whole page, you can have<h1>visually hidden with sr-only. Then you can swap those <h1> with <h2>.
  • In this challenge, the images are much likely to be decorative. For any decorative images, each img tag should have aria-hidden="true" attribute to make all web assistive technologies such as screen reader ignore those images .
  • The element button must not appear as a descendant of the a element. In this challenge, what would happen when the user click those learn more? In my opinion, clicking those "learn more" would likely trigger navigation not do an action so button elements would not be right. So you should use the <a. For future use , it's a good habit of specifying the type of the button to avoid any unpredictable bugs.
  • To know when to use one or the other in a specific situation, you must understand that every action on site falls under two different categories:

1. Actions where users affect the websiteā€™s back-end or front-end.

2. Actions where users wonā€™t affect the website at all.

Action where users affect the website itself is where you use a button. For example, sign-up and purchase actions are often buttons. The user in these situations are creating a new account and completing a monetary transaction, which are actions that affect the websiteā€™s back-end. Creating new posts or making comments are actions that change a websiteā€™s content and what the user sees.

Actions where users wonā€™t affect the website are where you use a link. These actions that take users from one page to another without changing anything on the websiteā€™s back or front-end.

  • 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.
  • In order to center the card on the middle of the page , you can use the flexbox properties and min-height: 100vh for the <body> add a little padding to the body that way it stops the card from hitting the edges of the browser.
  • width: 62.5rem; an explicit width is not a good way to have responsive layout . Consider using max-width to the card.
  • height: 32.1875rem; - It's not recommended to set fixed height to component, you almost never want to set it. let the content of the component define the height.
  • Consider using rem for font size , it' not recommended to use px for font size as absolute units donā€™t scale for example 15px will always be 15px on the same device. Using pixels is a particularly bad practice for font sizing because it can create some accessibility problems for users with vision impairments.
  • Remember a modern css reset on every project that make all browsers display elements the same.
  • Donā€™t Repeat Your CSS(DRY) is a good general principle to follow and eliminating duplication of css code should naturally be part of coding journey.

Hopefully this feedback helps.

Marked as helpful

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