Goal:
Display the picture and the card Title only as default.
When you have the mouse over the class card the text message "aaa" should appear and the card title and the picture will go up.
You can say that it is the same height but the picture size will be less height.
Problem:
I don't know how to solve it
Info:
Please take into account responsive design.
Jsbin:
https://jsbin.com/yelocuwime/edit?html,css,output
Thank you!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="cards">
<div class="card">
<img src="https://i.picsum.photos/id/638/200/300.jpg?hmac=oYRYfxaIBKyb10YHb6-3AGadeAdyEWX91vrVrqdTnGE" class="responsive" alt="" />
<div class="cardTitle">ONE</div>
<div>aaa<br /> aaaa</div>
</div>
<div class="card">
<img src="https://i.picsum.photos/id/638/200/300.jpg?hmac=oYRYfxaIBKyb10YHb6-3AGadeAdyEWX91vrVrqdTnGE" class="responsive" alt="" />
<div class="cardTitle">TWO</div>
<div>aaa<br /> aaaa</div>
</div>
<div class="card">
<img src="https://i.picsum.photos/id/638/200/300.jpg?hmac=oYRYfxaIBKyb10YHb6-3AGadeAdyEWX91vrVrqdTnGE" class="responsive" alt="" />
<div class="cardTitle">THREE</div>
<div>aaa<br /> aaaa</div>
</div>
</div>
</body>
</html>
.cards {
margin: 0 auto;
display: grid;
grid-gap: 5px;
}
.card {
width: 100%;
min-height: 100px;
background-color: #e6e6e6;
text-align: center;
border:1px solid white;
transition: border 1s;
}
.card:hover {
border:1px solid black;
}
.cardTitle {
width: 100%;
margin-top: -4px;
color: white;
background-color: grey;
font-size:xx-large;
}
.responsive {
width: 300px;
}
/* 2 column */
@media (min-width: 700px) and (max-width: 899px) {
div.cards {
grid-template-columns: repeat(2, 1fr);
}
}
/* 3 columns */
@media (min-width: 900px) {
div.cards {
grid-template-columns: repeat(3, 1fr);
}
}