Css 模組化

在圖形裡面將文字垂直置中

html

<div class="container">

          <ul class="flex_center">        

              <li><div><span>置中</span></div></li>            

              <li><div><span>置中<br>置中</span></div></li>            

              <li><div><span>置中<br>置中<br>置中</span></div></li>            

              <li><div><span>置中<br>置中<br>置中<br>置中</span></div></li>

          </ul>

</div>

css

.flex_center{
    list-style: none;
    box-shadow: none;
}
.flex_center li{
    float: left;
    width: 25%;
}
.flex_center div{
    background: none;
    width: 15vw;
    height: 15vw;
    margin: 0 auto;
    display: flex;
    align-items: center;
    border-radius: 50%;    
    background: yellow;
}
.flex_center div span{
    width: 100%;
    text-align: center;
}

results matching ""

    No results matching ""