问题图片(需要的效果是,返回按钮与项目名称在同一行,并且靠右):
原因:
当非float的元素和float的元素在一起的时候,如果非float元素在先,那么float的元素将被排斥
解决方案:
将按钮在所在html标签放到项目名称前面
解决后图片:
代码:
<div class="bk-search" style="padding-top: 0px; padding-bottom: 0px;height: 30px;vertical-align: middle;line-height: 30px;">
<span style="float: right;margin-top: 3px;"><button style="width: 60px;line-height: 20px;" type="button" class="button" οnclick="FH()">返回</button></span>
<span>项目名称:<s:property value="queryBean.pc.name"/></span>
</div>