Is there any ASCII character for
?

前端 未结 6 675
猫巷女王i
猫巷女王i 2020-12-25 11:38

Typically we all using HTML numbers or names in web pages. For example, & is & or &, and $, @

相关标签:
6条回答
  • 2020-12-25 11:49

    & 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 &#13; 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 an HTML line break or can be treated as whitespace, depending on the CSS white-space property.

    0 讨论(0)
  • 2020-12-25 11:51

    You may be looking for the special HTML character, &#10; .

    You can use this to get a line break, and it can be inserted immediately following the last character in the current line. One place this is especially useful is if you want to include multiple lines in a list within a title or alt label.

    0 讨论(0)
  • 2020-12-25 11:57

    <br> is an HTML element. There isn't any ASCII code for it.

    But, for line break sometimes &#013; is used as the text code.

    Or &lt;br&gt;

    You can check the text code here.

    0 讨论(0)
  • 2020-12-25 12:01

    In HTML, the <br/> tag breaks the line. So, there's no sense to use an ASCII character for it.

    In CSS we can use \A for line break:

    .selector::after{
       content: '\A';
    }
    

    But if you want to display <br> in the HTML as text then you can use:

    &lt;br&gt; // &lt denotes to < sign and &gt denotes to > sign
    
    0 讨论(0)
  • 2020-12-25 12:08

    No, there isn't.

    <br> is an HTML ELEMENT. It can't be replaced by a text node or part of a text node.

    You can create a new-line effect using CR/LF inside a <pre> element like below:

    <pre>Line 1
    Line 2</pre>

    But this is not the same as a <br>.

    0 讨论(0)
  • 2020-12-25 12:12

    The answer is amp#13; — change "amp" to the ampersand sign and go.

    0 讨论(0)
提交回复
热议问题