让文字通过div [英] Let text go through a div

查看:86
本文介绍了让文字通过div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,这是一项调查,其div就像您在Facebook上看到的一样。

Ok, this is for a survey where the div is the chart just like you see it on facebook.

基本上:

<div style='border:1px solid black;width:300px;'>    
<div style='width:100px;???'>This text is longer than the inner div tag.</div>
</div>

...但我希望文本不会中断并直接通过div。有人可以帮我吗?

...but I want the text not to break and go directly through the div. Can somebody help me with this?

推荐答案

您可以使用空格:nowrap 。确保您的 div 及其相关祖先没有 overflow:隐藏,否则您不会看到文本离开元素。

You can use white-space: nowrap. Ensure your div and its relevant ancestors don't have overflow: hidden otherwise you won't see the text as it leaves the element.

jsFiddle

这篇关于让文字通过div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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