I'm sure there is a simple answer to this, I've just completed some learning and am now trying to apply it. Annoyingly I've gotten flexbox etc to do what I want but I've run into this issue I can't workaround - even though I'm sure it's simple.
In the HTML below I have an image with text below it and I want no gap between the text box and the image - but on is there and I can't remove it.
Thanks for helping me learn.
.container{
background-color: black;
display: flex;
flex-direction: row;
gap: 0.313rem;
width: 38rem;
}
.card img{
width: 100%;
}
.text{
background-color: whitesmoke;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="/normalize.css">
<link rel="stylesheet" href="scratchpad.css" />
</head>
<body>
<div class="container">
<div class="card">
<div class="card-image">
<img src="https://source.unsplash.com/random" alt="" />
</div>
<div class="text">
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</div>
</div>
<div class="card">
<div class="card-image">
<img src="https://source.unsplash.com/random" alt="" />
</div>
<div class="text">
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</div>
</div>
</div>
</body>
</html>