简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8"> <link href="/static/next/css/tryit.css?v=2017082407" rel="stylesheet"/> <pre id="t1"> I have tabs inside! </pre> <p>点击“尝试一下”按钮,改变 PRE 元素的 tab-size 属性。</p> <button onclick="myFunction()">尝试一下</button> <script> function myFunction() { document.getElementById("t1").style.tabSize = "16"; document.getElementById("t1").style.MozTabSize = "16"; // 针对 Firefox 的代码 document.getElementById("t1").style.OTabSize = "16"; // 针对 Opera 的代码 } </script> <p><b>Note:</b> The tabSize property is currently only supported in Chrome.</p> <p><b>Note:</b> Firefox supports an alternative, the MozTabSize property.</p> <p><b>Note:</b> Opera supports an alternative, the OTabSize property.</p> <footer>简单教程,简单编程<br/>Copyright © 简单教程 www.twle.cn</footer>
运行结果: