CSS 2.1: Wrapping Text Inside a Div

I have HTML and CSS as shown in http://jsfiddle.net/Lijo/Ydjde/

The problem is that the text inside the div is not limited to the div. It breaks the div and writes. How can we wrap text inside the div itself with the following functions?

β€’ Full text will be readable

β€’ He will not break the div

Is there a way to use it in CSS 2.1 ? I believe word wrap is a feature of CSS 3.0.

Note. I have a width defined as width: 100 pixels; and width: 30 pixels; for the first and second divs

Note. Space is generated from the ASP.Net label control. Therefore, we cannot change / replace span . The problem should be solved with CSS.

<span id="detailContentPlaceholder_Label1">25123456789</span> 

enter image description here

Link:

+4
source share
4 answers

word-wrap: break-word; - your friend. See the updated JSFiddle .

+12
source

Do you mean word-wrap: break-word ?

http://jsfiddle.net/PhRKh/

(edit: oops, did not see another answer)

+2
source

I found something strange here about word-wrap only works with the width css property correctly.

here is a working demo that I prepared.

I know him too late, but he can help others!

+1
source
 you add change width:35px then work properly .fixedColumnValue{ width:auto; } 
0
source

Source: https://habr.com/ru/post/1433796/


All Articles