npm install bootstrap --save
がインストールされ、index.html
に追加されましたが、スタイルは変更されません。 (他のファイル内の)Boostrap CSSが動作しない
<link rel="stylesheet"
href="node_modules/bootstrap/dist/css/bootstrap.min.css">
マイコード:
<button type="submit" class="btn btn-default">Submit</button>
だけ私は、これは(下)index.htmlをするために、すべての作品を追加しますが、最初のWebの負荷が非常に遅い場合:
<!-- 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">
更新:(詳細)
ファイルbootstrap.min.cssは存在しませんが、コンソールはそれを見つけることができないと言います。
フォルダStrucure: メインフォルダがありますがang2projectで、その中のindex.html
-angular2_projects
-node_modules
-bootstrap
-dist
-css
bootstrap.min.css
-src
-index.html
実際にファイルパス 'node_modules/bootstrap/dist/css/bootstrap.min.css'をチェックして、そこにあるかどうか確認しましたか? – theblindprophet
あなたはこのファイルが存在することを確信していますか?コンソールにエラーがないかどうかチェックしてください?存在するかどうかを調べるために上記のファイルを探してみてください – cssGEEK
hrefは相対パスであるため、現在のパス/あなたのhtmlの – phuzi