@MelvinAguilar
Posted
Hello π. Congratulation on successfully completing your first challenge π ! !
I have some recommendations regarding your code that I believe will be of great interest to you.
Metadata ποΈ:
-
The
viewport
meta tag is missing. theviewport
meta tag is used to control the layout of the page on mobile devices. Add theviewport
meta tag to the<head>
tag:<meta name="viewport" content="width=device-width, initial-scale=1.0">
.You can check your solution on a mobile device to see how your solution is distorted by not using this tag. β οΈ
HTML π·οΈ:
- Wrap the page's whole main content in the
<main>
tag.
- Always avoid skipping heading levels; Starting with <h1> and working your way down the heading levels (<h2>, <h3>, etc.) helps ensure that your document has a clear and consistent hierarchy. Source π
Alt text π·:
-
The
alt
attribute should not contain the words "image", "photo", or "picture", because the image tag already conveys that information.If you want to learn more about the
alt
attribute, you can read this article. π.
CSS π¨:
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. Resource π.
- The
width: 100vw
property in thebody
tag is not necessary. This will create a horizontal scrollbar on some devices.
- Use
min-height: 100vh
instead ofheight
. Setting the height to 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation.
-
Avoid using
position: absolute
to center an element as it may result in overflow on some screen sizes. Instead, use the flexbox or grid layout for centering.Using flexbox layout:
body { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
Using grid layout:
body { min-height: 100vh; display: grid; place-content: center; }
Get more insights on centering in CSS here here π.
CSS Reset π:
-
You should use a CSS reset. A CSS reset is a set of CSS rules that are applied to a webpage in order to remove the default styling of different browsers.
CSS resets that are widely used:
Please don't worry if the suggestions are long, they are only details. Above all, the project is done wellπ. I hope those tips will help you! π
Happy coding!
Marked as helpful
@ankitwaware
Posted
@MelvinAguilar Thanks For Your Suggestion , I will Use it.