Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow text to spill outside div

Tags:

html

css

For a simple example, this: the text is supposed to be in one line, but it's broken down into three because of how small the div is. How do I let the text spill out of the div without it wrapping?

Html:

<div style="width: 20px;">Some text here</div>

Result:

Some
text
here

I want this:

Some text here
like image 212
idlackage Avatar asked Oct 10 '13 17:10

idlackage


People also ask

How do I enable text-overflow in CSS?

To clip at the transition between characters you can specify text-overflow as an empty string, if that is supported in your target browsers: text-overflow: ''; . This keyword value will display an ellipsis ( '…' , U+2026 HORIZONTAL ELLIPSIS ) to represent clipped text.

How do you put text over a div?

Answer: Use the CSS z-index Property You can use the CSS position property in combination with the z-index property to overlay an individual div over another div element.


1 Answers

Try this:

<div style="width: 20px; white-space: nowrap;">Some text here</div>
like image 153
Jacobson Avatar answered Sep 20 '22 22:09

Jacobson