如何将图像50%集中在元素的顶部

时间:2017-07-16 22:01:45

标签: html css

这怎么可能? https://gyazo.com/ef7b3c65b3b5e09906c01edcc7143c86¨

我想开发一个手机应用程序,这个设计看起来很棒,但我无法弄清楚如何做居中按钮?关于如何开始的任何提示?

由于

1 个答案:

答案 0 :(得分:0)

plus {
  display: block;
  position: relative;
  margin: auto;
  margin-top: -50px;
}

html ex:

<div class="panel">...</div>
<a class="plus" href="#plus"></a>

或用作display:inline-block并将text-align:center设置为parent div。 你也可以使用: 如果按钮宽度为250px - 使用125px

position: absolute; 
bottom: 10px;
left: 50%;
margin-left: -125px;