如何使用CSS将以下按钮居中对齐

时间:2019-04-25 18:51:15

标签: html css

如何使用CSS将以下按钮在Webapp上居中对齐?

  <a href="#carbcounter" class="ui-btn ui-btn-inline ui-corner-all">The Carb Counter</a>
  <a href="#add&delete" class="ui-btn ui-btn-inline ui-corner-all">Add & Delete Produce</a>`
  `<a href="#Login" class="ui-btn ui-btn-inline ui-corner-all" data-icon="action">Log in to the Blog</a>

1 个答案:

答案 0 :(得分:0)

使用以下代码在中间进行链接:

.btn-outer{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.btn-outer a{
  text-decoration: none;
  margin: 10px 0;
}
<div class="btn-outer">
  <a href="#carbcounter" class="ui-btn ui-btn-inline ui-corner-all">The Carb Counter</a>
  <a href="#add&delete" class="ui-btn ui-btn-inline ui-corner-all">Add & Delete Produce</a> 
  <a href="#Login" class="ui-btn ui-btn-inline ui-corner-all" data-icon="action">Log in to the Blog</a>
  </div>