如何将文本放置在页面右侧的按钮左侧,与文本无关尺寸?我现在正在使用绝对位置,但这可能不是一个很好的解决方案。对齐放置在页面右侧的按钮左侧的文本
<nav class="someLine">
<button type="button" class="back">Back</button>
<text class="errorMsg">I'm an error!</text>
<button type="button" class="continue">Continue</button>
</nav>
.errorMsg {
color: red;
font-weight: bold;
font-style: italic;
font-size: 10px;
position: absolute;
right: 120px;
margin: 5px;
}
.someLine {
position: relative;
margin: 30px 0px;
padding-top: 10px;
border-top: 1px solid #DDD;
}
.continue, #btnAddProduct {
position: absolute;
right: 0px;
}
感谢您的反馈!
为什么看起来绝对定位不是对你很好的解决的解决方案?它工作完美。 – 2015-02-23 08:57:53