编辑下面的代码:【加编码】
<html> <head> <style> #main { background-color:lightgrey; border:30px solid transparent; border-image: url('border.png'); border-image-slice: 30 30 30 30; border-image-width: 1 1 1 1; border-image-outset: 0; border-image-repeat: round; } </style> </head> <body> <div id="main"> <p> 这是一个使用图像作为边框的 DIV 元素。 </p> </div> <p>点击“尝试一下”按钮改变 borderImageOutset 属性的值。</p> <button onclick="myFunction()">尝试一下</button> <script> function myFunction() { document.getElementById("main").style.borderImageOutset = "5px 10px 20px 15px"; } </script> <p><b>注意:</b>Internet Explorer 10、Opera 和 Safari 5 不支持 borderImageOutset 属性。</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂