Design comparison
Solution retrospective
Hi, I would be happy getting some feedback and suggestions on the following questions, thanks!
Considering HTML:
- Do I need the <p> tag inside of the <footer> tag. I tried and come to the solution that I can avoid this tag, but that is bat for accessibility, right?
- Does the <time> has furthermore more functions. Why do I have to use the <time> tag. I think I can add this time to my meetings, but I can't 3)Can I avoid the .(dot) in the img's src attribute (relative path)
Considering CSS:
- <img> is a inline-block element. That's why it is better to give the <img> the display: block property, right?
- I am not sure when to use min-height, max-height and height, the same with width. Can someone check if I used it correctly and give maybe an example to illustrate?
- Is it a good idea to use display: inline-block for main > :nth-child(2). I get troubles when I set max-width of the main's selector to 20rem.
Thanks a lot!
Community feedback
- @MelvinAguilarPosted 11 months ago
Hello there 👋. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
- Yes, you need to use a paragraph.
footer
is a landmark, but its function is still to group a section of the page. It wouldn't be appropriate to have text directly inside the footer.
- Yes, you could eliminate the dot (".") but you must also remove the forward slash ("./") — both are correct ways to point to an image. For example, you can use
assets/images/illustration-article.svg
, and it will be understood that the image is in a folder namedassets
.
- Inline elements have space below them due to their inline behavior. By using
display: block
, you eliminate that reserved space. You can use Dev Tools to toggle this property and see that the image creates space below, pushing the text. It's worth mentioning that it's not padding.
-
Here an example of the use of height
-
min-height
: Sets a minimum height for the element, but if the content grows, it adapts to the content's height. -
height
: A fixed height. If there's less content, it will always have that height. If the content grows, it will overflow. -
max-height
: Adapts to the content but cannot grow more than a specified height. If it grows more, it will overflow.
By setting a minimum height of 100vh on the body element, you allow it to grow beyond those 100vh. This makes sense because on small screens, the content (your card) might be larger than 100% of the screen, and allowing it to adapt better.
Using max-width on your component allows it to resize horizontally if the screen is small, but it also restricts it from growing too much
-
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
3 - Yes, you need to use a paragraph.
- @Islandstone89Posted 11 months ago
Hi again, congrats on finishing another challenge - well done!
Both the HTML and CSS look good to me. The only things I would change, are:
-
The illustration image is decorative, so make the alt text empty:
alt=""
. -
I would give the "Learning" element a class and target it in the CSS using that, instead of
main > :nth-child(2)
. You could do the same for the image.
As for the
<time>
element, it is useful for Search Engine Optimization, among other things.0 -
Please log in to post a comment
Log in with GitHubJoin 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