如何更改bootstrap模式的边界半径?

Hik*_*ndo 27 css html5 css3 twitter-bootstrap-3 bootstrap-4

我无法更改bootstrap模式的边界半径.

.modal{
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    border-radius: 0px; 
}  
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

And*_*L64 40

您需要将边界半径应用于.modal-contentdiv而不是.modaldiv.

以下是将边界半径应用于引导模式的正确方法:

.modal-content  {
    -webkit-border-radius: 0px !important;
    -moz-border-radius: 0px !important;
    border-radius: 0px !important; 
}
Run Code Online (Sandbox Code Playgroud)

注意!important如果引导程序css 之后加载了自定义css,请删除标记.


小智 7

您可以只使用rounded-0引导程序类。

<div class="modal-content rounded-0">
</div>
Run Code Online (Sandbox Code Playgroud)


des*_*rti 6

也许你正试图塑造错误的元素.

根据getbootstrap.com/javascript/#static-example,你应该样式:

.modal-content
Run Code Online (Sandbox Code Playgroud)