<html> <head> <script type="text/javascript"> function setMinHeight() { document.getElementById("p1").style.minHeight="200px"; } </script> </head> <body> <p id="p1">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.</p> <input type="button" onclick="setMinHeight()" value="Set min height" /> </body> </html>
结果:
编辑上面的代码,点击查看结果。
yige.org
- 试一个