@VickyAzola
Posted
Hi there! 👋 Awesome job completing this challenge. Here are a few tips that may interest you:
First, it is important to use semantic HTML for accessibility purposes. Try wrapping your main content in the <main> tag instead of <div class="main__content">. And the attribution in a <footer>; also, it may be better to put the footer outside the recipe card. The code would look something like this:
<main class="main__content">
<img src="assets/images/image-omelette.jpeg" alt="" class="main__content-image" />
<h1>Simple Omelette Recipe</h1>
.....
</main>
<footer class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">
Frontend Mentor
</a>. Coded by <a href="#">Mark Matlock</a>.
</footer>
Here you can find more info on why it is important to use semantic HTML for accessibility.
Second, in this challenge the last content represents a table, so in this case it is more semantically accurate to use the html tag <table> instead of <div class="nutrition__grid-container">. Here is an example:
<table>
<tbody>
<tr>
<th>Calories</th>
<td>277kcal</td>
</tr>
<tr>
<th>Carbs</th>
<td>0g</td>
</tr>
<tr>
<th>Protein</th>
<td>20g</td>
</tr>
<tr>
<th>Fat</th>
<td>22g</td>
</tr>
</tbody>
</table>
Here you can find more info on <table> and how to use it.
For the line, you can remove it like this if you use a table:
tr {
border-bottom: 1px solid hsl(30, 18%, 87%);
}
tr:nth-child(4) {
border-bottom: none;
}
And like this, if you use your code:
.item {
padding: 1rem 0 1rem 1.2rem;
border-bottom: 1px solid var(--clr-neutral-grey);
}
.item:nth-child(7), .item:nth-child(8) {
border-bottom: none;
}
For the numbers, it may be because you are using the property font-style
instead of font-family
:
ol li::marker {
color: var(--clr-secondary-raspberry);
font-weight: var(--fw-bold);
font-style: var(--ff-body); ---> here
}
Lastly, for this challenge, there were two designs, one for mobile and the other for desktop. Check out the design folder and look for mobile-design.jpg image. In this case, the mobile design doesn't have any background, and the content takes up all the screen. When it is on desktop the background appears.
Hope this helps!
Marked as helpful
@techmatlock
Posted
Hi @VickyAzola!
Good point on using the main tag instead.
I was going to use a table but decided against it because I couldn't figure out how to make the table data elements all line up in a perfect vertical fashion so I went with grid instead. The 277kcal, 0g, 20g, etc. weren't lined up correctly when I applied padding to them.
I'll go ahead and make the changes on the ol li::marker rule.
I missed that mobile design feature even though I looked at the previews. Woops.
Thank you so much for the detailed feedback!