<style>
.glyphicon-envelope{
color: red;
font-size: 100px;
}
@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')}
</style>
</head>
<body>
<!--字体图标,放大不会失真bootstrap组件Glyphicons 字体图标;阿里巴巴矢量图标库-->
<span class="glyphicon glyphicon-envelope"></span>
<button class="btn btn-default">
<span class="glyphicon glyphicon-star"></span>这是一个按钮
</button>
我是老师的写法改成这个就完美了<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
Failed to load resource: the server responded with a status of 404 (Not Found)
这样的错误,如果将@font-face注释掉glyphicon-envelope这个就可以显示,但是star就不能显示了
<link rel="stylesheet" type="text/css" href="css/css/bootstrap.min.css"/>
.glyphicon-envelope{
color: red;
font-size: 100px;
}
@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')}
</style>
</head>
<body>
<span class="glyphicon glyphicon-envelope"></span>
<button class="btn btn-default">
<span class="glyphicon glyphicon-star"></span>这是一个按钮
</button>
</body>
出现问题报错是怎么说的呢? 复制你的代码,这样写是没有出现问题的
<link rel ="stylesheet" href="css/bootstrap.min.css">
<style>
.glyphicon-envelope{
color: red;
font-size: 30px;
}
</style>
</head>
<body>
<span class="glyphicon glyphicon-envelope"></span>
<button class="btn btn-default">
<span class="glyphicon glyphicon-star"></span>这是一个按钮
</button>
</body>
</html>