我想创建一个行会两个div之间之间走线。不幸的是,我不能让线在两个div之间垂直对齐。上面的图片是我目前正在获取的图片。下面是html。
.line {
vertical-align: middle;
margin-left: 120px;
margin-right: 200px;
border: 2px solid red;
}
section {
width: 100%;
margin: auto;
}
.home {
width: 20%;
margin-left: 50px;
float: left;
}
.logout {
width: 15%;
float: right;
margin-right: 50px;
}
<section>
<div class="home">Home</div>
<div class="line"></div>
<div class="logout">Reports
<button> <a href="web url"> log out </a>
</button>
</div>
</section>
我一直在使用一个小时标签试过,但我不能得到这工作的。
哈。你以10秒的时间击败了我。我花时间打出我的答案,并提交给你已经在这里看到你。 +1 –
@Chris Stanley对不起'')' –
感谢这对我有用。所以这将与除了Internet Explorer之外的所有内容兼容? – ray