Centering the link as the button

后端 未结 3 1594
暖寄归人
暖寄归人 2021-01-15 17:32



        
3条回答
  •  难免孤独
    2021-01-15 18:13

    What you can do is to change display: block to display: inline-block instead then add text-align: center to their parents instead of margin: 0 auto as follow:

    .button {
      display: inline-block;
      text-decoration: none;
      color: #103d82;
      background: #fff;
      border: 1px solid #d2cfcd;
      font-size: 1.4rem;
      line-height: 1;
      padding: 10px;
      text-align: center; 
    }
    
    div {
      text-align: center;
    }
    
    

提交回复
热议问题