【问题标题】:Align button horizontally center in the page [closed]在页面中水平居中对齐按钮[关闭]
【发布时间】:2017-09-05 03:05:15
【问题描述】:

如何在 html 正文的中心对齐按钮。谁来帮帮我

Page View of button

【问题讨论】:

  • 你能给我们一些代码吗?在这里我们真的无法为您提供帮助。
  • @Xogno 如此真实:P

标签: html css button


【解决方案1】:

你可以给按钮下面的 CSS 代码:

button{
margin: 0 auto;
}

你也可以在按钮的容器上使用 flexbox:

.container{
display: flex;
}

然后您可以使用以下内容:

button{
margin: auto;
}

【讨论】:

【解决方案2】:

给你,基本的。您没有提供代码,因此我们无法使用您的代码提供答案。

body {
  text-align: center
}
<button>center</button>

【讨论】:

  • @Downvoter 需要解释一下吗?
  • 可能是因为他们认为这是一个低质量的答案。告诉 OP 支持/接受您的问题可能也无济于事。
猜你喜欢
  • 2014-04-20
  • 2019-01-11
  • 1970-01-01
  • 2013-11-15
  • 2019-10-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多