js制作圆角按钮(兼容谷歌,ie7,ie8)
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <style type="text/css"> body { margin:0; } div { behavior: url(../js/PIE.htc); border: 10px solid green; -webkit-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5), 0px 1px 2px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5), 0px 1px 2px rgba(0, 0, 0, 0.2); box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5), 0px 1px 2px rgba(0, 0, 0, 0.2); background-color: #eeeeee; background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fbfbfb), color-stop(100%, #e1e1e1)); background: -webkit-linear-gradient(top, #fbfbfb, #e1e1e1); background: -moz-linear-gradient(top, #fbfbfb, #e1e1e1); background: -o-linear-gradient(top, #fbfbfb, #e1e1e1); background: linear-gradient(top, #fbfbfb, #e1e1e1); display: -moz-inline-stack; display: inline-block; vertical-align: middle; *vertical-align: auto; zoom: 1; *display: inline; border: 1px solid #d4d4d4; height: 32px; line-height: 32px; padding: 0px 25.6px; font-weight: 300; font-size: 14px; font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; color: #666666; text-shadow: 0 1px 1px white; margin: 0; text-decoration: none; text-align: center; } .button { -webkit-transition-property: background, color; -moz-transition-property: background, color; -o-transition-property: background, color; transition-property: background, color; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; -o-transition-duration: 0.3s; transition-duration: 0.3s; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; background: #00a1cb; color: white; text-shadow: none; border: none; cursor:pointer; } .button-rounded { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } .button:hover { background: #00b5e5; } /* line 183, ../scss/button.scss */ .button:active { background: #1495b7; color: #00647f; } .button.disabled { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } </style> </head> <body> <p>Test passes if there is a box with rounded corners below.</p> <div class="button button-rounded">Filler Text</div> <input type="button" value="提交" class="button button-rounded" style="width:50px; height:22px;"> </body> </html>
behavior: url(../js/PIE.htc);
这个引用htc文件的,指的是html页面相对于这个htc文件的路径,而不是css相对于htc文件的路径。
具体源码的下载
百度云网盘的地址: