[javascript] How can I change the default width of a Twitter Bootstrap modal box?

In Bootstrap 3 all you need is this

<style>
    .modal .modal-dialog { width: 80%; }
</style>

Most of the above answers did not worked for me !!!

_x000D_
_x000D_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>_x000D_
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />_x000D_
_x000D_
<style>_x000D_
  #myModal1 .modal-dialog {_x000D_
    width: 80%;_x000D_
  }_x000D_
  #myModal2 .modal-dialog {_x000D_
    width: 50%;_x000D_
  }_x000D_
</style>_x000D_
_x000D_
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal1">_x000D_
  80%_x000D_
</button>_x000D_
_x000D_
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal2">_x000D_
  50%_x000D_
</button>_x000D_
<center>_x000D_
  <!-- Modal -->_x000D_
  <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">_x000D_
    <div class="modal-dialog" role="document">_x000D_
      <div class="modal-content">_x000D_
        <div class="modal-header">_x000D_
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>_x000D_
          </button>_x000D_
          <h4 class="modal-title" id="myModalLabel">Modal title</h4>_x000D_
        </div>_x000D_
        <div class="modal-body">_x000D_
          custom width : 80%_x000D_
        </div>_x000D_
        <div class="modal-footer">_x000D_
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>_x000D_
          <button type="button" class="btn btn-primary">Save changes</button>_x000D_
        </div>_x000D_
      </div>_x000D_
    </div>_x000D_
  </div>_x000D_
_x000D_
_x000D_
  <!-- Modal -->_x000D_
  <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">_x000D_
    <div class="modal-dialog" role="document">_x000D_
      <div class="modal-content">_x000D_
        <div class="modal-header">_x000D_
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>_x000D_
          </button>_x000D_
          <h4 class="modal-title" id="myModalLabel">Modal title</h4>_x000D_
        </div>_x000D_
        <div class="modal-body">_x000D_
          custom width : 50%_x000D_
        </div>_x000D_
        <div class="modal-footer">_x000D_
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>_x000D_
          <button type="button" class="btn btn-primary">Save changes</button>_x000D_
        </div>_x000D_
      </div>_x000D_
    </div>_x000D_
  </div>_x000D_
_x000D_
</center>
_x000D_
_x000D_
_x000D_

Examples related to javascript

need to add a class to an element How to make a variable accessible outside a function? Hide Signs that Meteor.js was Used How to create a showdown.js markdown extension Please help me convert this script to a simple image slider Highlight Anchor Links when user manually scrolls? Summing radio input values How to execute an action before close metro app WinJS javascript, for loop defines a dynamic variable name Getting all files in directory with ajax

Examples related to jquery

How to make a variable accessible outside a function? Jquery assiging class to th in a table Please help me convert this script to a simple image slider Highlight Anchor Links when user manually scrolls? Getting all files in directory with ajax Bootstrap 4 multiselect dropdown Cross-Origin Read Blocking (CORB) bootstrap 4 file input doesn't show the file name Jquery AJAX: No 'Access-Control-Allow-Origin' header is present on the requested resource how to remove json object key and value.?

Examples related to twitter-bootstrap-2

TypeError: $(...).modal is not a function with bootstrap Modal GLYPHICONS - bootstrap icon font hex value Change the color of glyphicons to blue in some- but not at all places using Bootstrap 2 Padding In bootstrap How can I get my Twitter Bootstrap buttons to right align? Add vertical whitespace using Twitter Bootstrap? Change width of select tag in Twitter Bootstrap vertical-align: middle with Bootstrap 2 How can I change the default width of a Twitter Bootstrap modal box? Twitter-Bootstrap-2 logo image on top of navbar