JavaScript 空格屬性


  翻譯結果:

white

英[waɪt]   美[hwaɪt, waɪt]  

adj.白色的,純潔的;無色的,透明的;白衣的;白種人的

n.白色;白種人;空白;白色顏料

vt.(書寫,印刷等)留出空白處;使變白色,刷白;漂白

第三人稱單數: whites 複數: whites 現在分詞: whiting 過去式: whited 過去分詞: whited 比較級: whiter 最高級: whitest

#space

英[speɪs]   美[ spes]  

n.空間,太空;空白,間隔;空隙;片刻

vt.把…分隔開,留間隔於…之間

vi.以某間隔排列

第三人稱單數: spaces 複數: spaces 現在分詞: spacing 過去式: spaced 過去分詞: spaced

#

JavaScript 空格屬性語法

作用:設定如何處理文字中的空白符號(例如空格和換行符)。

語法:Object.style.whiteSpace=normal|nowrap|pre

JavaScript 空格屬性範例

<html>
<head>
<script type="text/javascript">
function removeWrapping()
{
document.getElementById("div1").style.whiteSpace="nowrap";
}
</script>
</head>
<body>

<div id="div1">
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.
This is some text. This is some text. This is some text.
</div>
<br />
<input type="button" onclick="removeWrapping()" 
value="Do not let the text wrap" />

</body>
</html>

執行實例 »

點擊 "執行實例" 按鈕查看線上實例

熱門推薦

首頁

影片

問答