一、行内元素的水平居中
处于块级元素包裹中的行内元素,其水平居中可在其父元素中使用text-align:center,代码如下:
#block-inline {
text-align: center;
}
<div id="block-inline">
<span>我是span标签</span> <br/>
<input type="button" value="按钮"/>
</div>
原始图为:
实现局中效果为: