JavaScript 参考手册
Style listStylePosition 属性
通过点击按钮缩进列表项标记
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <script> function displayResult() { document.getElementById("ul1").style.listStylePosition = "inside"; } </script> </head> <body> <ul id="ul1"> <li>Coffee</li> <li>Tea</li> <li>Water</li> <li>Soda</li> </ul> <br> <button type="button" onclick="displayResult()">缩进列表项的标记</button> </body> </html>
运行结果:
点击运行 »