2016-06-24 104 views
0

我想在我的角度項目中使用引導程序,我在看http://angular-ui.github.io/bootstrap/#/getting_started,但它表示其中一個要求是引導程序CSS。使用Angular-UI-Bootstrap。我如何從bootstrap獲取CSS?

如何只安裝CSS?什麼是最好的方式來做到這一點?我已經使用涼亭安裝了角度,角度動畫和角度引導。只需要安裝CSS。

這是我將如何使用它,請讓我知道,如果它的正確 -

<!DOCTYPE html> 
<html> 
    <head> 
    <script src="/bower_components/angular/angular.js"></script> 
    <script src="/bower_components/angular-animate/angular-animate.js"></script> 
    <script src="/bower_components/angular-bootstrap/ui-bootstrap.js"></script> 
    </head> 
    <body> 
     .... 
    </body> 
</html> 
+0

http://getbootstrap.com/getting-started /:* bower install bootstrap * –

回答

1

轉到Bootstrap's Get Started Page。他們給你幾種不同的選擇。這裏是他們的CDN:

<!-- Latest compiled and minified CSS --> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> 

而且鮑爾

$ bower install bootstrap 

之後,你有你的源只是<link>它在您<head>

<!DOCTYPE html> 
<html> 
    <head> 
    <script src="/bower_components/angular/angular.js"></script> 
    <script src="/bower_components/angular-animate/angular-animate.js"></script> 
    <script src="/bower_components/angular-bootstrap/ui-bootstrap.js"></script> 
    <!-- Bootstrap CSS CDN --> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> 
    <!-- Bootstrap CSS Bower *check folder for correct file name --> 
    <link rel="stylesheet" href="/bower_components/bootstrap/bootstrap.css"> 
    </head> 
    <body> 
     .... 
    </body> 
</html> 
+0

謝謝!我先用這個來測試,然後用bower把它安裝到我的項目中。謝謝 – user1354934

+0

太好了。很高興聽到它解決。繼續並將其標記爲正確,以幫助未來具有相同問題的其他人。 – EnigmaRM

0

你的代碼是完全正確的。你只需要從那裏下載引導。這將有CSS nd JavaScript。你應該通過涼亭

Bower install bootstrap 

添加CSS在你的腦袋標籤

您也可以安裝它之後檢查bower_components文件夾中找到引導

+0

謝謝!這很好。只是使用CSS :) – user1354934

相關問題