菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> <style> div{ background-color:lightgrey; border:30px solid transparent; border-image:url('border.png'); border-image-slice:30; border-image-width:10px; border-image-outset:0; border-image-repeat:round; } </style> </head> <body> <div id="main"> <p> 这是一个使用图像作为边框的 DIV 元素。 </p> </div> <p>点击“尝试一下”按钮改变 borderImageWidth 属性的值。</p> <button onclick="myFunction()">尝试一下</button> <script> function myFunction(){ document.getElementById("main").style.borderImageWidth = "20px 30px"; } </script> <p><b>注意:</b>Internet Explorer 10、Opera 和 Safari 5 不支持 borderImageWidth 属性。</p> </body> </html>
运行结果