首页 > 解决方案 > 如何在 div 中的 div 之后放置文本?

问题描述

我有以下圆圈和标题。

我希望 h4 在动画圆 div 内居中。我不能放在里面,因为我会旋转圆圈,而且我不希望文字旋转。

我有以下 CSS。目前,所有圆圈都相互堆叠。我希望他们有自己的间距。谢谢!

.animating-circle {
  position: absolute;
  min-width: 250px;
  min-height: 250px;
  box-sizing: border-box;
  border: 1px solid black;
  border-radius: 50%;
  border-top-color: #f1c40f;
  border-right-color: skyblue;
  border-bottom-color: violet;
  border-left-color: lightgray;
}

.animating-circle+h4 {
  position: relative;
  top: 120px;
}
<div class='animating-circle'></div>
<h4>Title is here</h4>

标签: htmlcsscentering

解决方案


推荐阅读