This is a solution from Dimitris Kaffes to the Recipe page challenge on Frontend Mentor.
Mobile-first design was implemented.
The main objective was to build a good HTML structure, using semantic landmark elements.
Custom properties were used for the colors, font-weight and margin-bottom.
Ordered and unordered lists with distinct marker coloring were used.
A table was used for the nutrition part. scope="row"
in the th
header cells of the table
improve accessibility.
The challenge is to build out this recipe page and get it looking as close to the design as possible.
- Solution URL: recipe-page solution on Github
- Live Site URL: recipe-page live site
A mobile-first approach was followed.
The HTML was structured using semantic elements.
Improvements relating to accessibility where taken into account:
- For the
image
element a detailedalt
attribute was added. - For the
table
element header cellsth
were added and were given thescope="row"
attribute.
The CSS styling was done trying to avoid unnecessary declarations.
Custom properties were used for the colors, font-weight and margin-bottom.
A very simple CSS reset was used.
A media query was used to slightly change the .wrapper
and the img
properties.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
- Further reinforced the process of building a solid HTML structure.
- Better organising the CSS stylesheet.
- How to manipulate lists and list markers.
- How to use the
table
element with all the related elements and attributes for improving accessibility.
A modern CSS reset must be used in future projects after understanding all its declarations.
Further investigating the accessibility subject.
- HTML table advanced features and accessibility - This helped me understand HTML tables.
- Lists - This article helped me with lists, list-types and markers.
- Frontend Mentor - @dkaffes