Hi ich möchte ein bild in mein div hinzufügen und es soll oben genau in das div passen ohne rand aber irgendwie bleibt dort immer ein weißer rand.
Hier ein stück meines Html code:
<section class="boxes">
<div class="buybox">
<img src="blume/sonnenblume.jpg">
</div>
<div class="buybox"></div>
<div class="buybox"></div>
<div class="buybox"></div>
</section>
Hier ein Stück von CSS:
div {
padding: 20px;
text-align: center;
box-sizing: border-box;
}
.boxes{
display: flex;
flex direction: row;
}
.buybox{
width: 400px;
height: 420px;
background: white;
margin: 25px;
box-shadow: 0 0 30px rgba(0, 0, 0, .2);
border-radius: 20px;
position: relative;
}
.buybox img{
border-radius: 20px;
height: auto ;
width: 100% ;
box-sizing: border-box;
margin: 0;
}
.buybox:hover{
transition: .2s;
background: #E6E6E6;
}