Book Image

Bootstrap for Rails

By : Syed F Rahman
Book Image

Bootstrap for Rails

By: Syed F Rahman

Overview of this book

Table of Contents (18 chapters)
Bootstrap for Rails
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Changing Bootstrap's modal size


Bootstrap's modals also come in various sizes: large, normal, and small. You need to use the following classes to change the size of the modal:

  • .modal-lg: This is for larger modals

  • No class: This is for normal sized modals

  • .modal-sm: This is for smaller modals

You have to add the preceding classes to the .modal-dialog element in the modal's markup. Take the following code as an example:

<div class="modal fade" id="myFirstModal">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">This is a modal</h4>
      </div>
      <div class="modal-body">
        <p>The content goes here.</p>
      </div>
      <div class="modal-footer">
        <p>This is the footer.</p>
      </div>
    </div>
  </div>
</div>

The preceding markup will create a larger modal, as shown in the following...