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 whiteSpace属性 语法

作用:设置如何处理文本中的空白符(比如空格和换行符)。

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

javascript whiteSpace属性 示例

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

运行实例 »

点击 "运行实例" 按钮查看在线实例

热门推荐