This is a solution to the Blog preview card challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- See hover and focus states for all interactive elements on the page
Expected solution:
- Solution URL: Blog Card Preview Repo
- Live Site URL: Blog Card Preview Live Site
- Semantic HTML5 markup
- CSS custom properties
- CSS Variables
- CSS Font-Faces
- Flexbox
- CSS Grid
- Mobile-first workflow
- How to use the tag to center the card.
body{
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
- How to make the mobile version take up the full width of the screen.
Taking into account that the card spans 4 columns in the original design.
main{
grid-column: span 4;
}
- How to keep the image from overflowing the container.
main img {
width: 100%;
object-fit: cover;
}
- How to apply states to links.
main h1 a:hover{
color:var(--Yellow);
}
main h1 a:focus{
color:var(--Yellow);
}
I intend to continue studying how to position elements using a combination of CSS Grid and Flexbox.
Perhaps it would have been easier to position the elements by splitting the grid into rows rather than columns.