下载 bootstrap 3.3.7 并提取所有文件,包括 css、字体和 js 文件夹。我将所有文件复制到 www/css 文件夹、www/js 和 www/css/fonts 在 index.html 中如下:
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
并在按钮上使用图标:
`<button type="button"><span class="glyphicon glyphicon-ok"></span>Yeah</button>
<button type="button">span class="glyphicon glyphicon-remove"></span>Nope</button>
`
在android平台上图标不能正确显示汉字,在iOS平台上显示其他花哨的图标,在windows平台上两个图标都不显示。
我尝试从 npm install bootstrap
下载
这只是将文件夹添加到 node_modules 并且任何方法都不起作用。
不使用
`<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">`
因为应用程序应该离线工作,所以将文件放在元素结构中。
请帮我解决这个问题。
最佳答案
检查 bootstrap.css 中的这些行并相应地更正字体文件夹的路径:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
关于ios - Bootstrap 字形图标显示错误的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48002882/