Strange problem with registration and spaces: nowrap in Chrome and IE

I ran into a really weird problem. ( http://jsfiddle.net/Fq68D/ )

HTML

<div> <p>Hello World!</p> </div> 

CSS

 div { display:inline-block; } p { background-color:#ccc; padding:10%; white-space:nowrap; } 

In Firefox, it works as expected, the text fits in p and has an addition,

While in Chrome and IE, the text goes out of the box.

enter image description here

What causes this? Any workarounds?

+6
source share
1 answer

Add a display: inline-block; element display: inline-block; in p :

http://jsfiddle.net/Fq68D/1/

+9
source

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


All Articles