html - 我如何使用 CSS 在我的 div 中居中这些按钮?

标签 html css

如何在 png 中将我的 div 中的按钮居中?

words.png

最佳答案

刚刚分配给它的容器 text-align: center;

div{
  text-align: center;
  border: 1px solid red;
  padding: 10px;
}
<div>
  <button>aaa</button>
  <button>aaa</button>
  <button>aaa</button>
  <button>aaa</button>
</div>

关于html - 我如何使用 CSS 在我的 div 中居中这些按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40780537/

相关文章:

html - 如何响应地在另一个图像上缩放图像

javascript - <noscripts/> 转义其自己的 &lt;iframe&gt; 内容

标题标签在 Safari 中的 CSS 文本定位不同

javascript - toggle() 不起作用并追加更多字段

javascript - Apple store 样式固定 div 在 LEFT

javascript - 如何使用事件处理程序操纵框阴影的颜色?

javascript - 创建一个表,单击该表会更新文本文件

html - 灰显 CSS Superfish 菜单

html - 使用滚动条在容器中水平对齐 div

html - 包含 h1/h2/h3 并使用 .css 文件在 html 文件中定位