I'm having trouble with flexbox. I'm trying to present book cards with a fixed footer (which will contain edit / remove buttons). but the footer of each card keeps running away, and results not in the same height. I searched in google and sof and found that:
.product-modify {
margin-top: auto;
margin-bottom: auto;
}
but it does not seem to work. I would appreciate any tips. I USE REACT BTW. DONT LAUGH AT ME. THIS IS A CODE SNIPPET WHICH DOES NOT RUN because I could not figure out how to add react es6 to here.
Thank You for any help (:
this is my css:
<div>
<h1 className="searchResultsHeadline">Search Results:</h1>
<section className="products">
{books.map((book, index) => (
<div key={book.id} className="product-card">
<BookCard />
</div>
))}
</section>
</div>
/* Book List */
.searchResultsHeadline {
font-family: "Montserrat", sans-serif;
}
.products {
display: flex;
flex-wrap: wrap;
}
.product-card {
flex: 1 17%;
margin: 30px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
width: 40%;
min-height: 100%;
padding: 5px;
}
.product-card:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.product-card:after {
content: "";
flex: auto;
}
.product-image img {
max-width: 100%;
border-radius: 5%;
}
.product-modify {
margin-top: auto;
margin-bottom: auto;
}
.empty-space {
height: 0 !important;
padding-top: 0 !important;
padding-bottom: 0 !important;
margin-top: 0 !important;
margin-bottom: 0 !important;
width: 130px;
height: 180px;
margin: 0 1% 24px;
}
@media (max-width: 600px) {
.product-card {
flex: 1 46%;
}
}
@media (max-width: 480px) {
.product-filter {
flex-direction: column;
}
}
{book.title}
By: {book.author} Date: {