Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change border radius of bootstrap modal?

I am unable to change the border radius of bootstrap modal.

.modal{     -webkit-border-radius: 0px;     -moz-border-radius: 0px;     border-radius: 0px;  }   

How should I do it?

like image 310
Hikaru Shindo Avatar asked Apr 06 '15 20:04

Hikaru Shindo


People also ask

How do I change the width of a modal in bootstrap 4?

Modal Size Change the size of the modal by adding the . modal-sm class for small modals, . modal-lg class for large modals, or . modal-xl for extra large modals.

How do you reduce the width of a modal?

Answer: Set width for . modal-dialog element Similarly, you can override the width property of . modal-sm , . modal-lg and . modal-xl class to resize the small, large and extra-large modal dialog box respectively.


1 Answers

BOOTSTRAP 3:

In Bootstrap 3, you need to apply the border radius to the .modal-content div element and not the .modal div element like this:

.modal-content  {     -webkit-border-radius: 0px !important;     -moz-border-radius: 0px !important;     border-radius: 0px !important;  } 

N.B. Remove the !important tags if your custom css is loaded after your bootstrap css.


BOOTSTRAP 4 & BOOTSTRAP 5:

In Bootstrap 4 & Bootstrap 5, you can just add the rounded-0 class name to your modal-content element (or to any other element) to set it's border radius to 0 like this:

<div class="modal" tabindex="-1" role="dialog">   <div class="modal-dialog" role="document">     <div class="modal-content rounded-0">         <!-- Your Modal content here -->     </div>   </div> </div> 
like image 138
AndrewL64 Avatar answered Oct 11 '22 18:10

AndrewL64