2017-01-25 37 views
-5

如何使用引導程序沒有這些鏈接「https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css如何在沒有在線鏈接的情況下使用引導程序?

我已經下載bootstrap.min.css文件,我使用這個類= localhost上「glyphicon glyphicon搜索」,但是這是行不通的,而不是顯示搜索圖標在他們的網站上。

+0

下載網站中的CSS和JS,然後在本地 –

+0

叫它閱讀:[CSS如何...](HTTP: //www.w3schools.com/css/css_howt o.asp) –

+0

請按照這個http://getbootstrap.com/getting-started/ –

回答

1

這是因爲您的瀏覽器正在計算機上的文件夾中查找圖形。如果您從CDN加載bootstrap,則glyphicons將相對於CSS文件進行鏈接。下面的示例...

下載從這裏舉:從外部引導文件http://getbootstrap.com/getting-started/#download

例如:

@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot); 

您可以更改正確的文件夾,以絕對的,下載的字體和字體的地方路徑或下載適當的引導文件(不是CDN)。

-2

如果你的文件夾結構是這樣的:

|-- index.html 
|-- style 
    |-- bootstrap.min.css 

那麼你要調用它在你的index.html文件的部分。就像這樣:

<head> 
    <!-- Other stuff will likely be in here... --> 
    <link href="/style/bootstrap.min.css" rel="stylesheet" /> 
</head> 

如果你最小化JavaScript文件,你會希望把他們在本節結束時這樣的標籤:

<body> 
    <!-- Other stuff will likely be in here... --> 
    <!-- Assume you have a directory named js at the same level as your HTML file --> 
    <script src="js/main.min.js"></script> 
</body> 
-1

第一個副本的bootstrap.min。在項目文件夾中的CSS文件,然後將這個代碼在HTML文件的頭部部分

<link href="bootstrap.min.css" rel="stylesheet" /> 
相關問題