[英]How to prevent rightmost inline element from wrapping or overflowing in CSS?
I give up! 我放弃!
Here's what I'm trying to accomplish: 这是我要完成的工作:
Fiddle : http://jsfiddle.net/Ws5Ts/1/ 小提琴 : http : //jsfiddle.net/Ws5Ts/1/
Desired behavior : 所需行为 :
item
div) item
div的右侧) item
div while the customer's name overflows item
div的右侧 I've been at this for the past two hours trying to use all different kinds of wrapping divs
with different positioning but I can't get anything to work exactly how I want it to. 在过去的两个小时中,我一直在尝试使用具有不同定位的所有不同类型的包装
divs
,但我无法按照我的要求进行任何操作。
Thanks! 谢谢!
How about putting the indicator outside your current div? 如何将指标置于当前div之外? Just made a really quick example of what I mean here: http://jsfiddle.net/Ws5Ts/3/
刚刚做了一个非常简单的例子,说明了我的意思: http : //jsfiddle.net/Ws5Ts/3/
My classes aren't very performance correct, but I'm off to bed :) 我的课表现不太好,但是我起床了:)
'
edit: See my comment about margin-left if that suits your layout better 编辑:如果更适合您的布局,请参阅我对左边距的评论
Ok I've spent WAY too much time on this. 好的,我在此上花了太多时间。
Possible solution : http://jsfiddle.net/Ws5Ts/17/ 可能的解决方案 : http : //jsfiddle.net/Ws5Ts/17/
Approach: 方法:
direction
to rtl
so that the text overflows to the left. direction
切换到rtl
,以使文本溢出到左侧。 This keeps the indicator where I want it but the text is now overflowing in the wrong direction. This seems to work in Chrome, Firefox, Safari and IE9. 这似乎可以在Chrome,Firefox,Safari和IE9中使用。
Anyone else have a less convoluted approach? 还有其他人没有那么费解的方法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.