简体   繁体   English

引导模态div上的圆角

[英]Rounded corners on bootstrap modal div

I have a .NET page that is using some Bootstrap markup to create a div that is later used as a popup modal. 我有一个.NET页面,它使用一些Bootstrap标记来创建一个div,稍后将其用作弹出模式。 I want to round the corners. 我想绕过角落。 While modifying the CSS seems to effect the border width and color, I cannot make border-radius work. 虽然修改CSS似乎会影响边框宽度和颜色,但我无法使border-radius起作用。 Here is my HTML: 这是我的HTML:

<div class="modal fade" id="productModal" tabindex="-1" role="dialog" aria-labelledby="productModalLabel" aria-hidden="true">
        <div class="modal-dialog ui-corner-all">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="productModalLabel">Product</h4>
                </div>
                <div class="modal-body" id="contentDiv">

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="orderClose">Close</button>
                    <button type="button" class="btn btn-primary" id="orderSave">Save Changes</button>
                </div>
            </div>
        </div>
    </div>

My JQuery calls a webservice that builds HTML and inserts int into #contentDiv and that works just fine. 我的JQuery调用一个构建HTML的web服务并将int插入到#contentDiv中,并且工作得很好。 Here is my CSS for the rounded corners: 这是我的圆角CSS:

.modal-header {
    padding:9px 15px;
    border-bottom:1px solid #eee;
    background-color: #0480be;
    -webkit-border-top-left-radius: 100px;
    -webkit-border-top-right-radius: 100px;
    -moz-border-radius-topleft: 100px;
    -moz-border-radius-topright: 100px;
     border-top-left-radius: 100px;
     border-top-right-radius: 100px;
 }


.modal-header {
    padding:9px 15px;
    border-bottom:1px solid #eee;
    background-color: #0480be;
    -webkit-border-bottom-left-radius: 100px;
    -webkit-border-bottom-right-radius: 100px;
    -moz-border-radius-bottomleft: 100px;
    -moz-border-radius-bottomright: 100px;
     border-bottom-left-radius: 100px;
     border-top-right-radius: 100px;
 }

.modal-dialog {
    border: 3px solid #000000;
    width: 900px;
    -webkit-border-radius: 100px;
    -moz-border-radius: 100px;
     border-radius: 100px;
}

Why won't border-radius work? 为什么边界半径不起作用? I have changed the number to some drastic things to see if it makes a difference but nothing changes. 我已经将数字改为一些激烈的东西,看它是否有所作为,但没有任何变化。 As stated, I can change anything in the border reference or the width reference and see the changes, so it is seeing the .modal-dialog class. 如上所述,我可以更改边框引用或宽度引用中的任何内容并查看更改,因此它会看到.modal-dialog类。 any ideas here? 这里有什么想法?

The answer was actually obvious but I was NOT thinking clearly. 答案实际上是显而易见的,但我并没有想清楚。 All I had to do was add !important after each line because the bootstrap.css was taking precendence. 我所要做的就是在每一行之后添加!important,因为bootstrap.css正在取得优势。 Once I added !important the problem was solved instantly. 一旦我添加!重要的是问题立即得到解决。 Just thought I would add this in case someone else has this problem in the future. 只是想我会添加这个以防万一其他人将来有这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM