2

Как поместить svg иконку в центр круга?

.circle {
  width: 80px;
  height: 80px;
  border: 2px solid none;
  border-radius: 50%;
  background: #e1e1e1;
}
<div class="circle">
  <img src="img/vk-icon.svg" alt="Вк">
</div>

2 ответа 2

5

.circle{
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flex;
  display: -o-flex;
  display: flex;
  border: 1px solid #000;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  justify-content: center;
  -ms-align-items: center;
  align-items: center;
}
<div class="circle">
  <img src="img/vk-icon.svg" alt="Вк">
</div>

4

.circle {
  width: 80px;
  height: 80px;
  border: 2px solid none;
  border-radius: 50%;
  background: #e1e1e1;
  display: flex;
}

.circle img {
  margin: auto;
}
<div class="circle">
  <img src="img/vk-icon.svg" alt="Вк">
</div>

Ваш ответ

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

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