Design comparison
Solution retrospective
Frankly, I couldn't understand where and how to use desktop and mobile width in the project, but I still tried to make the project similar.
What challenges did you encounter, and how did you overcome them?There are many ways to center the menu exactly in the middle of the page and the easiest way for me is to use flex.
What specific areas of your project would you like help with?Honestly I would like help in making it responsive and giving it a custom and mobile friendly width.
Community feedback
- @Islandstone89Posted 1 day ago
Hey, well done!
Here are some tips:
HTML:
-
<main>
holds all of the main content on a page. As a card would likely not be the only component on a page, I would wrap the card content in a<div class="card">
inside of<main>
. -
Remove
<article>
, it is not needed.
CSS:
-
Including a CSS Reset at the top is good practice.
-
Use the style guide to find the correct
font-family
andbackground-color
.Remember to specify a fallback font:font-family: 'Outfit',sans-serif;
-
I recommend adding a bit of
padding
, for example16px
, on thebody
, to ensure the card doesn't touch the edges on small screens. -
On the
body
, changeheight
tomin-height: 100svh
- this way, the content will not get cut off if it grows beneath the viewport. -
max-width
on the card should be in rem. Around20rem
will work fine. -
font-size
must never be in px. This is a big accessibility issue, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. -
On the image, add
display: block
andheight: auto
.
Marked as helpful0@mkalkandevPosted about 23 hours ago@Islandstone89 Thanks man, this is very useful information for me. I have a few questions to learn.
"On the image, add display: block and height: auto."
I don't really understand why we do this.
1@Islandstone89Posted about 10 hours ago@mkalkandev Glad to help.
height: auto
is used to maintain the image's aspect ratio.display:block
is used to avoid unwanted space underneath an image - say you have an image wrapped in a<div>
- you most likely want the image to take the full height of its container. Josh Comeau neatly explains why you should change the display value of images in this talk, from1:00
to around the 9th minute. I highly recommend the whole talk, actually. And I would check out his website, which has tons of excellent articles.0 -
- @VIS-WASPosted 5 days ago
It was containing semantic HTML elements. It was accessible and matching with expected outcome. Layout was looks good in all range of screen size. Code was well-structured,readable.
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