HTML5 数学运算符

htmlfront end technologyweb development更新于 2024/1/12 19:56:17

HTML5 数学运算符用于在 HTML 文档中表示数学和技术运算符。因此,要在网页中使用这些运算符,我们需要使用 HTML 实体名称。如果不存在实体名称,则可以使用十进制或十六进制引用的实体编号。

语法

以下是语法 −

&operatorName;

或

&#operatorHexcode;

或

&#operatorHexadecimalcode;

让我们看一个 HTML5 数学运算符的示例 −

示例

<!DOCTYPE html>
<html>
<style>
   body {
      color: #000;
      height: 100vh;
      background-color: #8BC6EC;
      background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
      text-align: center;
   }
</style>
<body>
<h1>HTML5 Mathematical Operator Demo</h1>
<p>Some Mathematical Symbols</p>
<p>&minus; -- minus sign</p>
<p>&deg; -- degree sign</p>
<p>&#8721; -- sigma sign</p>
<p>&gt; -- greater than sign</p>
<p>&ge; -- greater than or equal to sign</p>
<p>&lt; -- less than sign</p>
<p>&le; -- less than or equal to sign</p>
<p>&#8747; -- integration sign</p>
</body>
</html>

输出


相关文章


有用资源