Design comparison
Solution retrospective
- How would you vertically center the card in the page across all breakpoints?
A way I can think of is to create a container with the total height of the viewport and use flex or position. Though I'd have to use some media queries.
- Could you please share with me the screen sizes you take into account when programming (width and height)?
I have my own breakpoints, but I'd like to see other people's as well.
Thanks in advance :D
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
HTML 🏷️:
- This solution may cause accessibility errors due to lack of semantic markup, which causes lacking of landmark for a webpage and allows accessibility issues to screen readers, due to accessibility errors our website may not reach its intended audience, face legal consequences, and have poor search engine rankings, highlighting the importance of ensuring accessibility and avoiding errors.
- What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like
<div>
or<span>
. They are use to provide a more precise detail of the structure of our webpage to the browser or screen readers
- For example:
- The
<main>
element should include all content directly related to the page's main idea, so there should only be one per page - The
<footer>
typically contains information about the author of the section, copyright data or links to related documents.
- The
- So resolve the issue by replacing the
<div class="container">
element with the proper semantic element<main>
in yourindex.html
file to improve accessibility and organization of your page
COMPONENT MEASUREMENTS 📐:
- Use
min-height: 100vh
for.container
instead ofmin-height: 97vh
. Setting themin-height: 87vh
may result in on misplacing the component slightly than usual.
- So just set
min-height: 100vh
for.container
to ensure your component is properly placed center on all on types of devices.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful1@KlonnisterPosted over 1 year ago@0xAbdulKhalid It was helpful! Thank you very much for taking the time to take a look and provide feedback :)
0 - @HassiaiPosted over 1 year ago
Replace <div class="container"> with the main tag, <div class="title"> with <h1> and <div class="lead"> with <p> to make the content/page accessible. click here for more on web-accessibility and semantic html
Every html must have <h1> to make it accessible. Always begin the heading of the html with <h1> tag wrap the sub-heading of <h1> in <h2> tag, wrap the sub-heading of <h2> in <h3> this continues until <h6>, never skip a level of a heading.
Add the alt attribute
alt=" "
to the img tag and give it a value. The value of the alt attribute is the description of the image. For decorative images like icons, there is no need to give it an alt value, for more on alt attribute Click here.For a responsive content which wont require a media query for this challenge,
- Replace the width in .whitecontainer with max-width, increase its value and the height with a padding value for all the sides
max-width: 320px which is 20rem/em padding:16px which is 1rem/em
- Give the img a max-width of 100% and a border-radius value, the rest are not needed.
Give h1 and p the same font-size of 15px which is 0.9375rem, text-align: center, the same margin-left, margin-right and margin-top values. Give p a margin bottom value.
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful1@KlonnisterPosted over 1 year ago@Hassiai You don't know how helpful this wass! I'm very grateful for all the feedback you provided and how detailed it is.
Much appreciated, keep up that good feedback :)
0 - Replace the width in .whitecontainer with max-width, increase its value and the height with a padding value for all the sides
- @DereemiiPosted over 1 year ago
How would you vertically center the card in the page across all breakpoints?
- To center vertical and horizontal I used a container with 100vh , but first you have to normalize all the html elements with * box-sizing: border-box , margin & padding 0 so a scroll bar don't appear :), then set display flex, justify-content and align items to center :D hope this helps
Marked as helpful1 - @vanzasetiaPosted over 1 year ago
Hi, Dennis Herrera! 👋
Could you please share with me the screen sizes you take into account when programming (width and height)?
My answer is starting from 320px up to 1440px. I think 950px starts getting into the desktop layout. Ideally, all screen sizes should be considered when making a responsive website.
Learn more about the responsive website — What does it mean to "make a site responsive"?
I hope this answers your question. Have fun coding! 😄
1
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