HTML浮动右元素顺序 [英] HTML float right element order

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

问题描述

如果我有三个元素flaoted到右边,为什么顺序是(见jsfiddle)元素1是右侧的第一个元素,当元素3实际上是最后一个元素。

If I have three elements flaoted to right, why order is following (see jsfiddle) element 1 is first element on right side, when element 3 is actually last element.

订单现在

[3] [2] [1]

但是元素在html中按此顺序

But elements are in this order in html

[1] [2] [3]

为什么?

http://jsfiddle.net/A9Ap7/

推荐答案

倒序是预期的结果。

您可以在 CSS规格如果你愿意,但你的例子渲染,因为它应该。

You can dig around in the CSS Specification if you'd like, but your example renders as it ought to.

如果你希望他们以与标记相同的顺序显示,float .container 右,其子项离开。

If you'd like them to display in the same order as the markup, float the .container right, its children left.

已更新jsfiddle

这篇关于HTML浮动右元素顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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