前端——bootstrap沒法顯示圖標問題

在頁面上使用bootstrap的glyphicon圖標:css

<span class="glyphicon glyphicon-edit"></span>bootstrap

引用本地的bootstrap樣式文件跨域

<link type="text/css" rel="stylesheet" href="../bootstrapCss/bootstrap.min.css">svg

 

1.在你的css文件夾的同級目錄檢查是否有fonts文件夾,fonts文件夾中應該放入bootstrap下載包中的fonts文件夾下的4個有關字體圖標文件:字體

glyphicons-halflings-regular.woffspa

glyphicons-halflings-regular.ttfcode

glyphicons-halflings-regular.svgcdn

glyphicons-halflings-regular.eotit

 

2.引用本地的css文件,會引發跨域問題,也可使用官方的css文件連接地址:class

<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

相關文章
相關標籤/搜索