使用 HTML 实体的解决方案
许多符号可以很容易地与 HTML 实体一起显示。
在此代码中,我们可以看到显示无穷大、与号、插入符号、小于和大于以及版权和其他符号的示例。
要显示无穷大符号,请使用 HTML 实体:∞ 或者 ∞。
显示无穷大符号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> This is an example, which is used to display an infinity symbol ∞ (&infin;) using HTML. Also, you can use this version of the infinity symbol ∞ (&#8734;). </p> </body> </html>
要显示与号,请使用以下命令:& 或者 &。
显示与号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p>To display an ampersand &, use the following entity: &amp;. Or, you can also use &#38; .</p> </body> </html>
要显示插入符号,请使用以下内容:▲ 或者 ▼。
显示插入符号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p>To display a caret character, you can use ▲ or ▼. Choose the one you need.</p> </body> </html>
要显示“小于”和“大于”符号,请分别使用 < (<) 和 > (>)。
显示“小于”和“大于”符号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p>Example of using the "less than" < and "more than" > symbols.</p> </body> </html>
要显示“版权”符号,请使用以下内容:© 或者 ©。
显示“版权”符号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> Example of using the "copyright" symbol. To dis, use &copy; or &#169;.</p> </body> </html>
使用 ‘ 或者 ‘ 显示左单引号,使用 ’ 或者 ’ 显示右单引号。
显示左右单引号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> Example of using left and right single quotation marks. To display them, use &lsquo; or &#8216; for the left and &rsquo; or &#8217; for the right single quotation marks. </p> </body> </html>
使用“或者”显示左双引号,使用“或者”显示右双引号。
显示左右双引号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> Example of using left and right double quotation marks. To display them, use &ldquo; or &#8220; for the left and &rdquo; or "; for t he right double quotation marks. </p> </body> </html>
使用 ← 或者 ← 显示左箭头,使用 → 或者 → 显示右箭头。
显示左右箭头的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> Example of using left and right arrows. To display them, use &larr; or &#8592; for the left and &rarr; or &#8594; for the right arrow. </p> </body> </html>
使用 ↑ 或者 ↑ 显示向上箭头,使用 ↓ 或者 ↓ 显示向下箭头。
显示左右箭头的示例
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> Example of using up and down arrows. To display them, use &uarr; or &#8593; for the up arrow and &darr; or &#8595; for the down arrow. </p> </body> </html>
要显示“商标”符号,请使用 ™ 或者 ™。
显示“商标”符号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> Example of using a "trademark" symbol. To dis, use &trade; or &#8482;. </p> </body> </html>
要显示“注册商标”符号,请使用 ® 或者 ®。
显示“注册商标”符号的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> Example of using a "registered trademark" symbol. To dis, use &reg; or &#174;. </p> </body> </html>
要显示心形,请使用 ♥ 或者 ♥。
显示心脏的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> To display a heart, use &#9829; or &hearts;. </p> </body> </html>
要添加不间断空格,请使用 .
显示不间断空格的示例:
<!DOCTYPE html> <html> <head> <title>文档的标题</title> </head> <body> <h1>This is a heading</h1> <p> To display a non-breaking space, use &nbsp;. </p> </body> </html>
日期:2020-06-02 22:15:08 来源:oir作者:oir