浮点:右反转跨度的顺序 [英] Float:right reverses order of spans

查看:95
本文介绍了浮点:右反转跨度的顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有HTML:

<div>
    <span class="label"><a href="/index/1">Bookmix Offline</a></span>
    <span class="button"><a href="/settings/">Settings</a></span>
    <span class="button"><a href="/export_all/">Export</a></span>
    <span class="button"><a href="/import/">Import</a></span>
</div>

和CSS:

span.button {
    float:right;
}

span.label {
    margin-left: 30px;
}

在浏览器中,跨度以相反的顺序显示:导入导出设置。
我可以通过只更改CSS文件而保留HTML文件来更改顺序吗?

In the browser, spans display in the reverse order: Import Export Settings. Can I change the order by changing only the CSS file and leave the HTML as is?

推荐答案

这个问题是要逆转HTML中的正确浮动元素的顺序,或者将它们包含在一个包含元素中,并向右移动。

The general solution to this problem is either to reverse the order of the right floated elements in the HTML, or wrap them in a containing element and float that to the right instead.

这篇关于浮点:右反转跨度的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆