Design comparison
Solution retrospective
For this one I challenged myself to do a bit more research into how to properly use the elements. I also tried out the responsive layout first method which had me stumped for a bit before I got the hang of it. Definitely a method I will continue to try out since responsive is a weakness for myself. I also played around with using rem and em units instead of px for sizing and spacing. Please let me know how I did and if there's anything I can do to improve.
Community feedback
- @VCaramesPosted about 2 years ago
Hey there! 👋 Here are some suggestions to help improve your code:
- To center you content to your page, add the following to your Body Element:
body { min-height: 100vh; display: grid; place-content: center; }
- For this challenge you want to use the Picture Element not the Background Image Property. The Background Image Property is mainly used on decorative images
Picture Element will allow your to switch between images in different breakpoints and makes your site load faster by saving bandwidth.
Here is an example of how it works: EXAMPLE
Syntax:
<picture> <source media="(min-width: )" srcset=""> <img src="" alt=""> </picture>
More Info:
https://www.w3schools.com/html/html_images_picture.asp
https://web.dev/learn/design/picture-element/
-
Delete* the Section element and replace it with a Div.
-
The Header element is not needed for this challenge.
If you have any questions or need further clarification, let me know.
Happy Coding! 👻🎃
Marked as helpful0@KeithLionPosted about 2 years ago@vcarames I'm struggling to get the source image to show. The element only shows what's in the image tag and doesn't let me import an image for the source, but I am going to keep playing that. Most likely in code pen until I get it then integrate the element. Thank you for the feed back.
0@VCaramesPosted about 2 years ago@KeithLion
Since you built you component desktop first, change the
min-width
tomax-width
in the source element.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