HTML5 數學運算子


HTML5 數學運算子用於在 HTML 文件中表示數學和技術運算子。因此,若要將此類運算子用於網頁,需使用 HTML 實體名稱。如果不存在實體名稱,則可以使用實體編號,實體編號為十進位制或十六進位制引用。

語法

以下為 HTML5 數學運算子的語法 −

&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>

輸出

更新於:2019 年 10 月 1 日

2K+ 次瀏覽

開啟你的 職業生涯

完成課程後獲得認證

開始
廣告