更新时间:2023-11-08 22:23:40
&
是一个字符; & amp;
是该字符的HTML字符实体。 $ b
< br> ;
是一个元素。元素不会获得字符实体。
与此处的许多答案相反, \\\
或&#13;
不等于< br>
。前者表示文本文档中的换行符。后者旨在表示HTML文档中的换行符,并且通过其默认CSS来执行此操作:
br:之前{content:\A;空行:pre-line}
文本换行符可以呈现为HTML换行符,或者可以视为空白,具体取决于CSS white-space
属性。
Typically we all using HTML numbers or names in web pages. ex. & is &
or &
and $, @, ©, ®, ... etc.
Like the way I want to know is there any HTML number or name for <br>
?.
Any answer would be helpful?
Cheers!
&
is a character; &
is a HTML character entity for that character.
<br>
is an element. Elements don't get character entities.
In contrast to many answers here, \n
or
are not equivalent to <br>
. The former denotes a line break in text documents. The latter is intended to denote a line break in HTML documents, and is doing that by virtue of its default CSS:
br:before { content: "\A"; white-space: pre-line }
A textual line break can be rendered as a HTML line break, or can be treated as whitespace, depending on the CSS white-space
property.