如何使用jquery在DIV标签内制作圆角框?

Som*_*one 2 html jquery rounded-corners

我想在div标签内制作圆角框.我怎样才能做到这一点?你能举个例子吗?

A.B*_*ade 7

你可以使用CSS:

.rounded-corners {
    -moz-border-radius: 20px;
    -webkit-border-radius: 20px;
    -khtml-border-radius: 20px;
    border-radius: 20px;
}
Run Code Online (Sandbox Code Playgroud)

然后使用jQuery将类".rounded-corners"添加到div中:

$("#div-id").addClass("rounded-corners");
Run Code Online (Sandbox Code Playgroud)

  • `border-radius`和`box-shadow`不再需要供应商前缀.请参阅:[MDN浏览器兼容性表](https://developer.mozilla.org/en/CSS/border-radius#Browser_compatibility) (4认同)

Mar*_*le1 5

使用border-radius:10px和CSS.

另请看这篇文章:https://stackoverflow.com/questions/521432/best-jquery-rounded-corners-script