Mobile first using HTML and CSS only

Solution retrospective
This is my first submitted solution so I'm grateful for any useful feedback, especially on how to tidy up and simplify my code.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Rabin92
Hey, Lyndsey! 👋
Congratulations on completing your first challenge! 🎉 Your solution is looking good.
On small devices (portrait mode), there is horizontal scrolling caused due to the
fixed width
given to theimg tag
and thepadding
of50px
to themain tag
. To fix this issue you can remove the fixedwidth property
and addmax-width: 100%;
to#hero-image img
and then simply replace themain tag
padding
value to1em
.Here are few other suggestions:
- For a better user experience you can add
cursor: pointer
to thebutton tag
. - In your HTML code you have used
id attribute
as a selector. I would suggest you use aclass selector
instead becauseid's
are unique whereasclasses
are reusable. Check out this resource on the difference: https://css-tricks.com/the-difference-between-id-and-class/ - Currently it is still displaying a mobile wallpaper on larger devices. To display a desktop wallpaper, you can replace
background-image
to desktop on media queries. - I would suggest you use
relative units
instead offixed
. However, it depends on the different circumstances therefore to be clear you can watch this helpful tutorial on when to use differentCSS Units
by Kevin Powell - https://www.youtube.com/watch?v=N5wpD9Ov_To - Regarding your code, it's looking good. Just keep coding, practicing and you will start seeing a difference.
Hope this helps and Happy Coding! 😊
- For a better user experience you can add
Join 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