As mentioned by @Joãoluiz, avoid using !important
, Because in the future you may want to overwrite your own styles, and in addition, developers who have legacy your code will have difficulty changing it. According to Stephanie Sullivan [Rewis], designer, This is a very selfish act.
Each selector in CSS has one score, score or weight. The more specific the selector, highest will be your priority, as your score will be higher.
The !important
is only recommended when some class must be hard code, practically immutable, only loses to the declarations inline.
This way, the best way to override the CSS of Twitter Boostrap is declaring their own classes and putting them after the inclusion of the framework in question.
To best way to do this is as follows:
Include your styles
<head>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/seu_css.css">
</head>
Use the same names as the Twitter Bootstrap classes
.container{
max-width: 50%;
}
Could also put the snippet in HTML?
– Sérgio Torres
Make sure your css are imported into html after bootstrap
– Miguel