0

Я знаю, что можно сделать с помощью db + m0, auto или тега center, но тогда bg растягивается на весь экран. Можно ли это обойти?

/* contact */
.contacts {
  padding-top: 90px;
}

.cont__title {
  font-weight: 600;
  font-size: 34px;
  text-align: center;
  color: #070707;
  margin-bottom: 40px;
}

.cont__disc {
  font-weight: 400;
  font-size: 18px;
  text-align: center;
  line-height: 27px;
  color: #070707;
  margin-bottom: 40px;
}

.cont__btn {
  font-weight: 400;
  font-size: 18px;
  padding: 8px 23px 8px 23px;
  background-color: #000;
  color: #fff;
  border-radius: 40px;
  margin-bottom: 80px;
  text-decoration: none;
  margin: 0 auto;
}

.cont_social {
  display: flex;
  justify-content: center;
  margin-bottom: 50px;
}

.social {
  margin-right: 60px;
}

.cont__rec {
  font-size: 14px;
  text-align: center;
  font-weight: 400;
  line-height: 21px;
}
<div class="contacts">
      <div class="cont__title">Contacts</div>
      <div class="cont__disc">
        Want to know more or just chat? <br />
        You are welcome!
      </div>
      <a href="#" class="cont__btn">Send message</a>
      <div class="cont_social">
        <img src="img/LinkedIn.svg" alt=":(" class="social" />
        <img src="img/Instargam.svg" alt=":(" class="social" />
        <img src="img/Behance.svg" alt=":(" class="social" />
        <img src="img/Dribble.svg" alt=":(" />
      </div>
      <div class="cont__rec">
        Like me on <br />
        LinkedIn, Instagram, Behance, Dribble
      </div>
    </div>

1
  • Добавьте text-align: center; к .contacts и будет вам счастье.
    – ΝNL993
    8 фев в 20:33

1 ответ 1

0

Я разобрался! Нужно всего лишь обернуть тег a в любой другой (div например) и уже к нему применить стиль text-align: center;

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.