Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to remove horizontal line from the modal body and footer?

I want to remove horizontal lines from my modal

$(document).ready(function(){
$('#myModal').modal('show');
});
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Modal Header</h4>
      </div>
      <div class="modal-body">
        <p>Some text in the modal.</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>

As you can see there is a line above and below the content

like image 291
Ali Athar Avatar asked Aug 10 '18 07:08

Ali Athar


3 Answers

I think you are talking about the borders applied to modal. Use the below code.

.modal-header {
    border-bottom: 0 none;
}

.modal-footer {
    border-top: 0 none;
}
like image 64
Charu Maheshwari Avatar answered Oct 22 '22 15:10

Charu Maheshwari


Its been 2 years since this question was asked and I still don't see any answer with bootstrap so here it is, Just use the border-0 class in the header and footer div. That should do the trick.

<div class="modal-header border-0">
....
</div>

<div class="modal-footer border-0">
....
</div>
like image 29
Mohammad Faisal Avatar answered Oct 22 '22 15:10

Mohammad Faisal


Try this...

.no-border{
  border:none;
}

and simply add to your class

<div class="modal-header no-border">
like image 8
JL Barcelona Avatar answered Oct 22 '22 15:10

JL Barcelona