css如何让两个并列的按钮 水平居中显示
来源:互联网 发布:淘宝店铺怎么装修上新 编辑:程序博客网 时间:2024/05/29 04:46
1、原有button样式为水平向左对齐
.button {
float: left;
min-width: 54px;
max-width: 250px;
display: block;
margin: 0.3em;
padding: 0.4em 1em;
border: none;
background: none;
color: inherit;
vertical-align: middle;
position: relative;
z-index: 1;
-webkit-backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
}
2、但是有一种情况,在表格中显示按钮时,表格的其他列的文字都是居中的,
<td>
<button class="button button--round-l button--border-thin" onclick="brandUpdate('${CPBrandBean.parentBrand}','${CPBrandBean.childBrand}', '${CPBrandBean.source}')">
<span><span>修改</span></span>
</button>
<button class="button button--round-l button--border-thin" onclick="brandDelete('${CPBrandBean.parentBrand}')">
<span><span>删除</span></span>
</button>
</td>
如果用上面的样式就会在列中的按钮也会水平向右显示,这样就不美观了,将样式更改如下:
.button {
/*float: left;*/
min-width: 54px;
max-width: 250px;
display: inline-block;
/*margin: 0.3em;*/
margin:auto;
padding: 0.4em 1em;
border: none;
background: none;
color: inherit;
vertical-align: middle;
position: relative;
z-index: 1;
-webkit-backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
}
- css如何让两个并列的按钮 水平居中显示
- css如何让两个并列的按钮 水平居中显示
- 如何让两个 TextView 在 RelativeLayout 中水平居中显示
- CSS常见的让元素水平居中显示的方法
- CSS常见的让元素水平居中显示方法
- CSS常见的让元素水平居中显示方法
- CSS常见的让元素水平居中显示方法
- css如何让浮动元素水平居中
- css如何让文字水平垂直居中
- 如何让图片水平 居中显示
- 如何用CSS让按钮居中显示
- css如何让元素水平居中、垂直居中
- html之如何让多个并列的div居中显示
- 如何让已知高度的容器在页面中水平垂直居中 两个方法
- CSS 如何让li横向居中显示
- CSS 如何让li横向居中显示
- CSS:如何让元素在页面中水平垂直居中?
- css中水平居中显示
- SpringBoot:AOP Aspect切面编程
- CentOs7下搭载分布式Hadoop2.9
- linux添加新磁盘和创建分区
- xmind破解方法
- python3 连接 mysql 遇到乱码问题解决方案
- css如何让两个并列的按钮 水平居中显示
- canvas系列教程05-柱状图项目3
- springboot 基于 maven 自定义格式打包
- gradle编译: Plugin with id 'java-library' not found.
- SQL Server 数据库规范
- Junit源码阅读心得(1)
- 单链表找交点
- 炫酷简单的loading效果
- canvas系列教程06-柱状图项目4