當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


HTML5 MathML supscriptshift屬性用法及代碼示例

此屬性定義了將下標移動到表達式基線以下的最小空間。 <mmultiscripts>,<msub>和<msubsup>標記接受此屬性。

用法:

<element supscriptshift length="length">

屬性值:

  • length:此屬性以特定單位保持數字,這將使下移量移至基線以下。

以下示例說明了HTML5 MathML中的下標轉換:

例:



<!DOCTYPE html> 
<html> 
  
<head> 
    <title> 
        HTML5 MathML supscriptshift Attribute 
    </title> 
</head> 
  
<body> 
    <center> 
        <h1 style="color:green"> 
            GeeksforGeeks 
        </h1> 
  
        <h3> 
            HTML5 MathML supscriptshift Attribute 
        </h3> 
  
        <math> 
            <mfenced> 
                <mrow> 
                    <msub supscriptshift="5px"> 
                        <mi>x</mi> 
                        <mn>2</mn> 
                    </msub> 
                    <mo>+</mo> 
                    <msub supscriptshift="5px"> 
                        <mi>y</mi> 
                        <mn>2</mn> 
                    </msub> 
                    <mo>=</mo> 
                    <msub supscriptshift="5px"> 
                        <mi>z</mi> 
                        <mn>2</mn> 
                    </msub> 
                </mrow> 
            </mfenced> 
        </math> 
    </center> 
</body> 
  
</html>     

輸出:

支持的瀏覽器:supscriptshift屬性支持的瀏覽器如下:

  • Firefox




相關用法


注:本文由純淨天空篩選整理自skyridetim大神的英文原創作品 HTML5 MathML supscriptshift Attribute。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。