Design comparison
Solution retrospective
In the beginning I wasn't sure of how to get the rounded corners of the different areas aswell as centering things vertically and horizontally.
I am probably having the wrong font-weights and area sizes. I also weren't able to implement the custom fonts.
How could I implement a custom font? Also, whats the best practice to centering something vertically and horizontally or is my solution I found on StackOverflow already a good one?
StackOverflow solution:
- top: 50%;
- left: 50%;
- -ms-transform: translate(-50%, -50%);
- transform: translate(-50%, -50%);
Community feedback
- @HassiaiPosted over 1 year ago
Replace<div class="wrapper">with the main tag, <span class="font700"> with <h1> and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
There is no need for <br> in the html.
Add the alt attribute
alt=" "
to the img tag to fix the error issue. The value of the alt attribute is the description of the image.To center .wrapper on the page using flexbox or grid, 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 .wrapper on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .wrapper on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
Replace the height in .wrapper with a padding value for all the sides, this will prevent the content from overflowing on smaller screens and its a responsive replacement.
padding: 15px
. Give the img a max- width of 100% instead of a fixed max-width and max- height values.Give .content a margin value for all the sides, text-align: center and a font-size of 15px which is 0.9375rem, this will be the font-size of both p and h1.
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 - @charlie-techorsePosted over 1 year ago
Instead of downloading the whole font you can just add it in your html. When you select the font style in google font you, on the rigth side of the screen you get the options you selected. and below that you have the google font import link and the way to use the font family in css. If the right side partial is not open it can be opened by clicking the top right icon in the menu.
for centering I use a display: flex with justify-content:center(horizontal centering) and align-content: center(vertical centering)
hope this helps
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