This is a solution to the Recipe page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Your challenge is to build out this recipe page and get it looking as close to the design as possible.
You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go.
- Semantic HTML5 markup
- CSS custom properties
- Mobile-first workflow
How to use the CSS counter-reset
and counter-increment
properties and the CSS counter()
function to customize the style of an ol
element.
counter-reset
initalize thecount
with0
counter-increment
increase1
tocount
counter()
- get the current value of thecount
Suppose we want to style the following ol
element, which
each li
child must have the ✅
checkbox before its number:
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>
ol {
/**
* remove the default
* list style
*/
list-style: none;
/* set 0 to "my-count" */
counter-reset: my-count;
}
li::before {
/**
* increase 1 to "my-count"
* for each li
*/
counter-increment: my-count;
/* ✅ [n] */
content: "✅ " counter(my-count) " ";
}
✅ 1 HTML
✅ 2 CSS
✅ 3 JavaScript
It would be nice if I could:
- Implement the design of this challenge without using CSS Media Query.
- Animate each recipe section when the user is scrolling on the page.
- W3Schools - here is where I've learned how to work with
counter-reset
,counter-increment
andcount()
.
- Github - @alberto-rj
- Frontend Mentor - @alberto-rj
- Twitter - @albertorauljose