如何讓div中的a標籤上下左右居中對齊

案例:
 

<div class="show-more">
 
    <a href="###">LEARN MORE</a>
 
</div>


解決方案:
 

   .show-more{
      width: 200px;
      height: 30px;
      border: 1px solid red;
      border-radius: 20px;
      text-align: center;
      display:table;
    }
    .show-more a{
      display:table-cell; 
      vertical-align:middle;
    }
 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章