javascript - How to increase the width of a modal-body of twitter bootstrap modal popup -


i have twitter bootstrap modal popup

<div class="modal fade" id="div1" tabindex="-1" role="dialog" aria-labelledby="mymodallabel"             aria-hidden="true">             <div class="modal-dialog custom-class">                 <div class="modal-content">                     <div class="modal-header">                         <button type="button" class="close" data-dismiss="modal" aria-label="close">                             <span aria-hidden="true">&times;</span></button>                         <h4 class="modal-title" id="h2">log</h4>                     </div>                     <div class="modal-body">                   <asp:gridview id ="gridview1" runat="server" autogeneratecolumns="false"                   cssclass="table table-hover table-striped"                   datakeynames="fieldid"                   font-name="verdana" gridlines="both"                   font-size="10pt" cellpadding="4">                    <columns>                         few columns                 </columns>               </asp:gridview>              </div>           <div class="modal-footer">             <button type="button" class="btn btn-default" data-dismiss="modal">close</button>         </div>     </div>  </div> </div>     

and css is

@media screen , (min-width: 768px) {     .custom-class {         width: 70%; /* either % (e.g. 60%) or px (400px) */     } } 

but css changes not reflecting on pop-up

the grid columns coming out of body, mean body not increasing width of grid.how can make width of body more responsive

grid

add "modal-wide" main modal div, , adjust width in css. in example, i'm using 90%. since i'm using jquery set max-height of content area based on browser dimensions, modal tall necessary, , provide scrollbar if needed.

<a data-toggle="modal" href="#normalmodal" class="btn btn-default">normal</a>  <a data-toggle="modal" href="#tallmodal" class="btn btn-primary">wide, tall content</a>  <a data-toggle="modal" href="#shortmodal" class="btn btn-primary">wide, short content</a>  <div id="normalmodal" class="modal fade"></div> <div id="tallmodal" class="modal modal-wide fade"></div> <div id="shortmodal" class="modal modal-wide fade"></div> 

jsfiddle

i hope work you.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -