https://idea-hack.com/recipe/bootstrap-4-%e3%83%a2%e3%83%bc%e3%83%80%e3%83%ab%e3%82%b5%e3%83%b3%e3%83%97%e3%83%ab-10/

Bootstrap 4 モーダルサンプル 10

DEMO

RECIPE

HTML
 <div class="container d-flex justify-content-center">
     <div class="row">
         <div class="col-md-6"> <button type="button" class="btn btn-lg btn-warning" data-toggle="modal" data-target="#myModal">Open Modal</button> </div>
     </div>
 </div>
 <div class="modal fade" id="myModal" role="dialog">
     <div class="modal-dialog">
         <div class="card">
             <div class="text-right cross"> <i class="fa fa-times"></i> </div>
             <div class="card-body text-center"> <img src="https://i.imgur.com/HGAvgxi.png">
                 <h4>Phrase "Discovery" sent!</h4>
                 <p>Your phrase has been sent to nick's email. Once he takes action. you will be notified!</p>
             </div>
         </div>
     </div>
 </div>
CSS
 @import url(http://fonts.googleapis.com/css?family=Calibri:400,300,700);

 body {
     background-color: #4CAF50;
     font-family: 'Calibri', sans-serif !important
 }

 .mt-100 {
     margin-top: 100px
 }

 .container {
     margin-top: 200px
 }

 .card {
     position: relative;
     display: flex;
     width: 450px;
     flex-direction: column;
     min-width: 0;
     word-wrap: break-word;
     background-color: #fff;
     background-clip: border-box;
     border: 1px solid #d2d2dc;
     border-radius: 4px;
     -webkit-box-shadow: 0px 0px 5px 0px rgb(249, 249, 250);
     -moz-box-shadow: 0px 0px 5px 0px rgba(212, 182, 212, 1);
     box-shadow: 0px 0px 5px 0px rgb(161, 163, 164)
 }

 .card .card-body {
     padding: 1rem 1rem
 }

 .card-body {
     flex: 1 1 auto;
     padding: 1.25rem
 }

 p {
     font-size: 14px
 }

 h4 {
     margin-top: 18px
 }

 .cross {
     padding: 10px;
     color: #4CAF50;
     cursor: pointer
 }
Source
  • https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css
  • https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js
  • https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
  • https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css