This is a solution to the Stats preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout depending on their device's screen size
- Solution URL: (https://github.com/em-ewaa/Challenge-2)
- Live Site URL: (https://em-ewaa.github.io/Challenge-2/)
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Desktop-first workflow
- CSS @media Rule
- To use
.img {
background: no-repeat url("/Challenge-2/images/image-header-mobile.jpg");
background-size: cover;
background-color: var(--soft-violet);
padding-top: 73.5%;
}- To center the content with viewport units and flexbox:
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}- To manage background property and filters:
.img {
background: no-repeat url("/Challenge-2/images/image-header-desktop.jpg");
background-size: cover;
background-position: right top;
background-color: var(--soft-violet);
background-blend-mode: multiply;
}I will focus more on developing the layout with flexbox and do more research about different displays avaiable in CSS.
- w3schools - Aspect Ratio - This article showed me how to keep aspect ratio of the element with bacgkround-image.
- Website - [Ewa Majowska]

