简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8"> <link href="/static/next/css/tryit.css?v=2017082407" rel="stylesheet"/> <style> div { background-color: lightgrey; border: 30px solid transparent; border-image: url('/static/i/css3/border.png'); border-image-slice: 30 30 30 30; border-image-width: 1 1 1 1; border-image-outset: 0; border-image-repeat: stretch; } </style> <div id="main"> <p> DIV 使用图像边框。 </p> </div> <p>点击 “点我” 按钮来设置 borderImageRepeat 属性的值为 "round"。</p> <button onclick="myFunction()">点我</button> <script> function myFunction() { document.getElementById("main").style.borderImageRepeat = "round"; } </script> <p><b>注意: </b>Internet Explorer 10, Opera 12, 和 Safari 5 不支持 border-image-repeat 属性。</p> <footer>简单教程,简单编程<br/>Copyright © 简单教程 www.twle.cn</footer>
运行结果: