javascript textIndent属性
翻译结果:
text
英 [tekst] 美 [tɛkst]
n.文本,原文;课文,教科书;主题;版本
v.发短信
第三人称单数: texts 复数: texts 现在分词: texting 过去式: texted
indent
英 [ɪnˈdent] 美 [ɪnˈdent]
vt.切割…使呈锯齿状;缩进排版
n.(印刷中的)缩进;订单,订购
第三人称单数: indents 现在分词: indenting 过去式: indented 过去分词: indented
javascript textIndent属性语法
作用:缩进元素中的首行文本。
语法:Object.style.textIndent=length|%
javascript textIndent属性示例
<html> <head> <script type="text/javascript"> function setTextIndent() { document.getElementById("div1").style.textIndent="50px"; } </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="setTextIndent()" value="Indent first line of text" /> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例