Design comparison
Solution retrospective
I had a great experience while building this project. However, I had a bid of difficulty is using the CSS media query syntax to make the page responsive when opened on a smaller device. I read materials and CSS documentation, but I still didn't get a hang of it. I would appreciate it if someone can put me through on the use of CSS media query in making a page responsive on smaller screens. Also, I would like to know the best practices when it comes to styling divs, items in a div, class and ids. how are they to be written in the CSS when styling.
Community feedback
- @HassiaiPosted almost 2 years ago
Replace <div id="body"> with the main tag and <h2> with <h1> to fix the accessibility issue. click here for more on web-accessibility and semantic html
For a responsive content which won't require a media query for this challenge, replace the width in #content with max-width, and give the img a max-width of 100% instead of an inline styling with a fixed width and height value.
There is no need to give #content a height value and position: relative and its properties.
There is no need to style #body give the background-color you gave to #body to the body.
To center #content on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center #content on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center #content on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
Give h1 and p the same font-size of 15px and 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
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