“I HAVE” to add a space to an empty DIV tag?

I read a book about AJAX, and the author said that you always need to add space inside empty div tags so as not to jeopardize compatibility issues in "some browsers".

So that would be wrong <div></div>, and that would be right <div> </div>.

Question: Is he an idiot or does he know something?

Thank.

+3
source share
3 answers

He is not an idiot. IE 8 (perhaps earlier versions?) Will subtly ruin your layout if your empty div is really empty; adding a comment seems to be the proposed way to deal with it, but apparently the space also works.

+6
source

&nbsp; !

+1

, . ie8 - !

+1
source

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


All Articles