html - 如何减少圆圈中两行文本之间的空间

标签 html css

我得到一个带有 2 行文本的圆圈。 第一个说:P 第二个说:出版物。

他们之间的空间目前太大了。有没有办法让空间变小?

.circle1 {
  font-family: Arial;
  text-align: center;
  background: #73B7DB;
  border-radius: 100px;
  width: 110px;
  height: 105px;
  padding-top:5px;
  color: #fff;
  margin: 0 auto;
}
.Capital {
  margin: 0px 0 0px 0;
  line-height:70px;
  font-size: 60px;
  font-weight:ligter;
}
.text {
  text-align: center;
  margin-top: 0px !important;
  font-weight: 100;
  font-size: 15px;
}
<div class="circle1">
  <h2 class="Capital">P</h2>
  <span class="text">Publications</span>
</div>

最佳答案

尝试负 margin。像 margin: 0px 0 -10px 0 用于 .Capital

.circle1 {
  font-family: Arial;
  text-align: center;
  background: #73B7DB;
  border-radius: 100px;
  width: 110px;
  height: 105px;
  padding-top: 5px;
  color: #fff;
  margin: 0 auto;
}

.Capital {
  margin: 0px 0 -10px 0;
  line-height: 70px;
  font-size: 60px;
  font-weight: ligter;
}

.text {
  text-align: center;
  margin-top: 0px !important;
  font-weight: 100;
  font-size: 15px;
}
<div class="circle1">
  <h2 class="Capital">P</h2>
  <span class="text">Publications</span>

</div>

关于html - 如何减少圆圈中两行文本之间的空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45565278/

相关文章:

HTML 最佳实践 : Should I use &rsquo; or the special keyboard shortcut?

html - 在 Bootstrap 3.0 Modal 中,禁用滚动条但它仍然占用空间

iPhone 上的 jQuery/CSS 导航故障

css - ie6定位

html - 在 svg 上显示文本

html - Safari 边界半径溢出问题

javascript - Reactjs:将侧边栏组件导入到不同的页面

javascript - HTML5 Dragend 事件没有在 Firefox 中触发

css - jQuery UI 可排序 : Prevent horizontal scrolling with connected lists between full height columns

html - 删除边距或填充?