Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Let text go through a div

Tags:

css

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

Basically:

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

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

like image 805
faq Avatar asked Nov 15 '25 00:11

faq


1 Answers

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.

like image 159
alex Avatar answered Nov 17 '25 21:11

alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!