有時咱們引用別人寫的插件不知道某個樣式在哪兒,或者想要覆蓋其它樣式,就要用到 !importan;css
例如如下是引用boostrap,默認bootstrap都是圓邊框,咱們不想用,例子中同同樣式也出現多個importan,則寫在最下面的生效。html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .no-radius{ border-radius: 0 !important; } .radius-8{ border-radius: 8px !important; } </style> <link rel="stylesheet" href="../bootstrap-3.3.7-dist/css/bootstrap.css" /> </head> <body style="background: blue;"> <button type="button" class="btn btn-default navbar-btn radius-8 no-radius">Sign in</button> <script src="../jquery-3.3.1.js"></script> <script src="../bootstrap-3.3.7-dist/js/bootstrap.js"></script> </body> </html>