引导模态div上的圆角

时间:2013-12-30 22:31:39

标签: javascript jquery html css twitter-bootstrap

我有一个.NET页面,它使用一些Bootstrap标记来创建一个div,稍后将其用作弹出模式。我想绕过角落。虽然修改CSS似乎会影响边框宽度和颜色,但我无法使border-radius起作用。这是我的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>

我的JQuery调用一个构建HTML的web服务并将int插入到#contentDiv中,并且工作得很好。这是我的圆角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;
}

为什么border-radius不起作用?我已经将数字改为一些激烈的东西,看它是否有所作为,但没有任何变化。如上所述,我可以更改边框引用或宽度引用中的任何内容并查看更改,因此它会看到.modal-dialog类。这里有什么想法吗?

1 个答案:

答案 0 :(得分:4)

答案显而易见,但我并没有想清楚。我所要做的就是在每一行之后添加!important,因为bootstrap.css正在取得优势。一旦我添加!重要的是问题立即得到解决。我想我会添加这个以防万一其他人将来遇到这个问题。