css - Bootstrap modal width -
css - Bootstrap modal width -
i trying create modal popup alter it's width matches col-lg-8, col-xs-10
but found modal fixed width.
so, found css styling can alter width:
<div class="modal fade" id="mdlbudgets" role="dialog"> <div class="modal-dialog"> <div class="modal-content modal-graph col-lg-8 col-xs-10 well-sm"> <div class="row"> <div class="col-xs-12"> <span class="glyphicon glyphicon-align-left debit_colour"></span> <strong>budgets</strong> </div> </div> @if (model.bardescriptions.length == 0) { <small><span class="glyphicon glyphicon-info-sign debit_colour"></span> have no budgets setup yet.</small> } else { <div id="budgets"></div> } <div class="row"> <div class="col-xs-12 text-right"><a href="@url.action("budgets", "budget")" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-list"></span> view budgets</a></div> </div> </div> </div> </div>
css:
body .modal-graph { /* new custom width */ width: 700px; /* must half of width, minus scrollbar on left (30px) */ margin-left: 350px; }
however, firstly, it's off centre, biggest issue - it's fixed size. there way create modal-graph deed col-lg-8, col-xs-10 ?
as said .modal-dialog
has fixed width have overwrite it. utilize col-xx-xx class
, have center them. like:
<div class="modal fade" id="mdlbudgets" role="dialog"> <div class="modal-dialog as-container"> <div class="modal-content modal-graph col-lg-8 col-xs-10 well-sm"> <div class="row"> <div class="col-xs-12"> <span class="glyphicon glyphicon-align-left debit_colour"></span> <strong>budgets</strong> </div> </div> @if (model.bardescriptions.length == 0) { <small><span class="glyphicon glyphicon-info-sign debit_colour"></span> have no budgets setup yet.</small> } else { <div id="budgets"></div> } <div class="row"> <div class="col-xs-12 text-right"><a href="@url.action("budgets", "budget")" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-list"></span> view budgets</a></div> </div> </div> </div> </div>
and css:
@media (min-width: 768px) { .modal-dialog.as-container { width: 750px; } } @media (min-width: 992px) { .modal-dialog.as-container { width: 970px; } } @media (min-width: 1200px) { .modal-dialog.as-container { width: 1170px; } } .modal-dialog.as-container .modal-content { float: none; margin: auto; }
css twitter-bootstrap
Comments
Post a Comment