[英]Horizontally aligning elements of different heights and unknown widths using css
使用以下代码并根据您的需要进行修改。
div{display:table;width:100%;border:1px solid;} span{display:table-cell;height:150px;text-align:center;vertical-align:middle;} .btn{float:right;} h1{margin:0;}
<div> <span class="title"> <input type="button" class="btn"></input> <h1>This is the title</h1> </span> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.