Design comparison
Solution retrospective
There are two questions I would like to ask while completing this challenge:
-
Flex box was used for putting the footer in the bottom. I created a body::before and uses space-between to centralize the card and place footer in the bottom. It worked well in desktop version, but in mobile version, the card shrink into the size that could not hold all the content. I finally hard coded the height of the card to solve the problem. Are there ways to auto expand the height of the card?
-
I used two div to add color filter to header image.
html: <header class="image"> <div class="layer"> </div> </header>
css:
header{
flex: 0 0 auto ;
width: 50%;
background-image:url("./images/image-header-desktop.jpg");
background-size: cover;
background-position: center center;
position: relative;
.layer{
width: 100%;
height: 100%;
background-color: $soft_violet;
opacity: 50%;
}
}
But the color looks so different due to the change of opacity, are there any ways to deal with changing the background image color?
Thank you!! Any other feedback are also welcomed!
Community feedback
- @zeerobitPosted almost 3 years ago
Congrats on completing this challenge. Few points i'd like to share:
- use rem instead of px since px is not scalable
- you don't need min-width on the card
- don't need the
body::before
to center the card since you already have flexbox on the body selector, simply addalign-items: center;
and change justify-content fromspace-between
tocenter
- for the color filter add
mix-blend-mode: multiply;
to your class .layer then change the opacity to 75%. You can read about blend-mode here mix-blend-mode - i notice you use percentage quite often, gotta be careful how and where you use it since it can break your layout and causes responsive issues. keep in mind percentage relies on the parent size, here you can read more about it percentage -i'd advise to start with mobile layout first when designing a webpage to ensure that your users' experience is seamless on any device , here you can read more mobile first design
Hope this helps, you may ask if something is unclear. Happy coding !!!
Marked as helpful1
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