HTML
<!--карточка товара-->
<div class="card exmpl">
<img src="1c20926eb904ab8d597253b3824c5515.jpg">
<div class="name">
<h2>Диван Sunday</h2>
</p>
</div>
<div class="price">
<h4>344$</h4>
</div>
<p><button>Добавить в корзину</button></p>
</div>
<div class="card exmpl">
<img src="1c20926eb904ab8d597253b3824c5515.jpg">
<div class="name">
<h2>Диван Sunday</h2>
</p>
</div>
<div class="price">
<h4>344$</h4>
</div>
<p><button>Добавить в корзину</button></p>
</div>
CSS
/*Карточка товара*/
.card {
position: relative;
top: 150px;
background: #ffffff;
width: 180px;
height: 200px;
border: 2px solid #000000;
border-radius: 8px;
}
.exmpl img {
height: 135px;
width: 100%;
border: none;
border-radius: 8px;
margin-left: -2px;
position: relative;
top:-2.5px;
}
.name{
text-align: center;
position: relative;
top: -50px;
}
.price{
text-align: center;
position: relative;
top: -70px;
color: #696969;
}
.card button {
border: none;
outline: 0;
padding: 12px;
color: #ffffff;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
height: 40px;
font-size: 15px;
position: relative;
top: -87px;
}
.card button:hover {
border-radius: 15px;
background-color: #FFDEAD;
}
/*2x*/
.card {
position: relative;
top: 150px;
background: #ffffff;
width: 180px;
height: 200px;
border: 2px solid #000000;
border-radius: 8px;
}
.exmpl img {
height: 135px;
width: 100%;
border: none;
border-radius: 8px;
margin-left: -2px;
position: relative;
top:-2.5px;
}
.name{
text-align: center;
position: relative;
top: -50px;
}
.price{
text-align: center;
position: relative;
top: -70px;
color: #696969;
}
.card button {
border: none;
outline: 0;
padding: 12px;
color: #ffffff;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
height: 40px;
font-size: 15px;
position: relative;
top: -87px;
}
.card button:hover {
border-radius: 15px;
background-color: #FFDEAD;
}