Hi, The html looks great but there are some problems in the css at the moment.
- Never limit the height of elements that contain text, including the body. Min-height 100vh is fine to use, height is not. This is causing content to be cut off at the top on some screen sizes / for users with different text sizes.
- The max width on the component must be in rem not px so it scales properly even when users have a larger default text size set.
- Make sure the component can't hit screen edges. Either add a little padding to the body or a little margin to the component (on all sides).
- You can place text align center on the component itself instead of repeating it on the heading and paragraph because text alignment is inherited by children. (Optional)
- I recommend you place classes directly on what you want to style instead of using
class element
selectors. It's good to try and keep specificity low and it means if the html ever has to change in future the css would not break.
Marked as helpful
@AbdulHaseebHussainRI
Posted
@grace-snow Thanks for all the advice, I've been reading your blog and it has inspired some of the decisions I've made. I take on board all the above advices, they are all very much valid.
Do you also use rem units with padding, row gaps and margins or only for font sizes and min-width?
@AbdulHaseebHussainRI it depends. I use rem anywhere I would want the property to scale with the userβs default text size. (And I think you meant max-width)