Центр (круг) Div в нижнем колонтитуле - PullRequest
0 голосов
/ 27 января 2019

В моем нижнем колонтитуле есть кружок Div, и я хочу центрировать его в нижнем колонтитуле.В конце будет 3 круга подряд.How it looks Мой CSS:

.circle {
  height: 50px;
  width: 50px;
  background-color: rgba(0, 0, 0, 0.90);
  border-radius: 50%;
  text-align: center;
  font-size: 30px;
}

footer {
  text-align: center;
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: green;
}

1 Ответ

0 голосов
/ 27 января 2019

Вы можете использовать display:flex и align-items & justify-content для выравнивания по вертикали и горизонтали.

body, html {
  padding: 0;
  margin: 0;
}
footer {
  width: 100%;
  background-color: #dedede;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.circle {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background-color: black;
}
<footer>
<div class="circle"></div>
</footer>
...