Css problem on a FEM Challenge

Hello, I m trying to solve another FEM challenge And again im stuck. I have now this : https://roelofwobben.github.io/recipe_page/ but I cannot make the preperation time like this : Can anyone help me figure this out
No description
15 Replies
Chris Bolson
Chris Bolson2mo ago
Give the parent element a max width (based on your image, I suspect that it doesn't really need this), an inline margin of "auto" and some rounded corners. Then replace the <dl> with <ul> as that is clearly what the design requires - as I mentioned in your previous post about the same issue, you have complicated this for yourself by using the wrong element.
ἔρως
ἔρως2mo ago
<dl> is the wrong element semantically speaking
roelof
roelofOP2mo ago
chips, then Ragnar has pointed me to the wrong direction So with the ul and li I can make the text as the picture says it schould be
ἔρως
ἔρως2mo ago
yes but you may need some touches to center it like that, you likely will need to use an inline grid
roelof
roelofOP2mo ago
o, I thought I could be done with flex and justify-content
ἔρως
ἔρως2mo ago
yeah, you might be able to pull it off i was wrong here: it needs to be grid, not inline
roelof
roelofOP2mo ago
oke And it still need to be a ul and li ?
ἔρως
ἔρως2mo ago
yeah, to be semantically correct
roelof
roelofOP2mo ago
oke, some work to do and this is a beginners one 😢
ἔρως
ἔρως2mo ago
that is something a novice should be able to do after some time
roelof
roelofOP2mo ago
oke, but it does not give me the confidence I need
roelof
roelofOP2mo ago
changed it to this :

<ul>

<li>
Total
</li>
<li>
Approximately 10 minutes
</li>
</ul>


<ul>

<li>
Total
</li>
<li>
Approximately 10 minutes
</li>
</ul>

but now I see this:
No description
ἔρως
ἔρως2mo ago
that's the correct output
Chris Bolson
Chris Bolson2mo ago
Why break them into 2 <li> elements? That defeats the purpose. Once again, I feel that you are over complicating things. I would go with something like this:
<ul>
<li><strong>Total</strong> Approximately 10 minutes</li>
<li><strong>Preparation</strong> 5 minutes</li>
<li><strong>Cooking</strong> 5 minutes</li>
</ul>
<ul>
<li><strong>Total</strong> Approximately 10 minutes</li>
<li><strong>Preparation</strong> 5 minutes</li>
<li><strong>Cooking</strong> 5 minutes</li>
</ul>
In the CSS, remove the default list-style (as the bullet point has to remain vertically centered) and add it as a ::before pseudo element on the <li> Add the ":" as an ::after pseudo element on the <strong>
roelof
roelofOP2mo ago
oke, work to do

Did you find this page helpful?