A
A
Arbusik2021-10-01 23:46:59
css
Arbusik, 2021-10-01 23:46:59

2 product cards connected, how to duplicate them at different distances?

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;
  }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question