direction 屬性設(shè)置元素的文本方向。
Object.style.direction=ltr|rtl|inherit
值 | 描述 |
---|---|
ltr | 默認。內(nèi)容從左向右流動。 |
rtl | 內(nèi)容從右向左流動。 |
inherit | 內(nèi)容流動從父元素繼承。 |
本例把文本設(shè)置為從右向左流動:
<html>
<head>
<script type="text/javascript">
function changeTextDirection()
{
document.getElementById("p1").style.direction="rtl";
}
</script>
</head>
<body>
<p id="p1">This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.</p>
<input type="button" onclick="changeTextDirection()"
value="Set text to flow right to left" />
</body>
</html>
如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答?。?點擊進入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號