If you are looking to create your own CSS class, it's important to avoid using the !important property as it is considered bad practice in coding. The !important property in CSS overrides all subsequent rules on an element, which can lead to conflicts with existing stylesheets like Bootstrap.
Using your custom CSS class without the !important rule will prevent any issues with Bootstrap styling. However, if you apply !important to Bootstrap classes in a large project, it may cause problems down the line.
.mybutton {
margin: 20px 20px;
border-radius:100px !important;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<button type="button" class="btn btn-primary mybutton">Primary</button>
Alternatively, you can also style elements by chaining classes together as shown below. However, creating a separate custom class is recommended for better maintainability and organization of your code.
.btn.btn-primary{
margin:20px;
border-radius:60px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<button type="button" class="btn btn-primary">Primary</button>