html - What is the difference between   and space? -


there 2 snippets of html code:

1.

<div>&nbsp;</div> 

2.

<div> </div> 

i run them in chrome 43.0.2357.130m separately.

the first snippet's div has height(height=18px), second doesn't have height(height=0).

i wonder why have different result.

thank you:-)!

&nbsp non-breakeable space. means interpreted character. exemple, 2 words separated &nbsp: stay together, 2 words separated space can separated new line if container small.

a simple space "meh, i'm here if need me, can change if want me <3", &nbsp more "i'm here"

in exemple, space seems useless (no words before , after) desappear. &nbsp still here. consider &nbsp same way if invisible letter more space.


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -