【问题标题】:CSS responsive circlesCSS 响应式圆圈
【发布时间】:2017-09-18 04:34:38
【问题描述】:

如何将图标和文本(在图标下方)居中对齐,以便在调整大小时它们保持在矩形 div 内的相同位置?这是我的意思的例子。 Example

【问题讨论】:

    标签: html css svg layout


    【解决方案1】:

    .card{
      width: 300px;
      height: 400px;
      border: 1px solid skyblue;
      
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
    
    .circle{
      width: 30px;
      height: 30px;
      border-radius: 100%;
      background: green;
    }
    <div class="card">
      <span class="circle"></span>
    </div>

    尝试使用display: flex

    【讨论】:

      猜你喜欢
      • 2012-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-19
      • 1970-01-01
      • 2020-09-07
      相关资源
      最近更新 更多