<bdo> 元素 (HTML雙向覆蓋元素)用于覆蓋當(dāng)前文本的朝向,它使得字符按給定的方向排列。
指定文本方向:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>HTML5 Example by www.soo66.com</title> </head> <body> <h1>Famous seaside songs</h1> <p>The English song "Oh I do like to be beside the seaside"</p> <p>Looks like this in Hebrew: <span dir="rtl">??, ??? ???? ????? ??? ??? ???</span></p> <p>In the computer's memory, this is stored as <bdo dir="ltr">??, ??? ???? ????? ??? ??? ???</bdo></p> <p>該段落文字從左到右顯示。</p> <p><bdo dir="rtl">該段落文字從右到左顯示。</bdo></p> </body> </html>測試看看 ?/?
IEFirefoxOperaChromeSafari
所有主流瀏覽器都支持 <bdo> 標(biāo)簽。
bdo 指的是 bidi 覆蓋(Bi-Directional Override)。
<bdo> 標(biāo)簽用來覆蓋默認(rèn)的文本方向。
無。
屬性 | 值 | 描述 |
---|---|---|
dir | ltr rtl | 必需。規(guī)定 <bdo> 元素內(nèi)的文本方向。 屬性值可為: |
<bdo> 標(biāo)簽支持 HTML 的全局屬性。
<bdo> 標(biāo)簽支持 HTML 的事件屬性。