html - 字形图标未显示,但同事的代码相同
问题描述
我的同事向我发送了这个确切的代码,并且在他的页面上确实显示了图标。在我的页面上他们没有。但这很奇怪,因为它的代码相同。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<span class="glyphicon glyphicon-home"></span>
</body>
</html>
解决方案
您当前的代码有一些无效的空白字符,请尝试直接从站点替换(复制粘贴)以避免此类错误。
<!DOCTYPE html>
<html>
<head>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<!-- won't work -->
<span class="glyphicon glyphicon-home"></span>
<span class="glyphicon glyphicon-envelope"></span>
<!-- works fine -->
<span class="glyphicon glyphicon-home"></span>
</body>
</html>
推荐阅读
- r - 带有外部和嵌入式 yaml 的 RMarkdown
- swift - 在 swift 中使用 @propertyWrapper 替代隐式解包可选
- frameworks - 所有后端框架都支持微服务吗?
- php - 使用 2 个参数 codeigniter 更新数据
- mongodb - Docker MongoDB 不会启动“不允许操作”
- python - 将网络摄像机连接到 python/opencv
- node.js - NEXT.JS:无法使用 getInitialProps 连接到 mongoDB 数据库
- flutter - Dart/flutter 小部件测试,无论是按键还是文本都找不到文本小部件
- python - 从元组内的多个字典中获取项目
- python - Matplotlib 在我的图表上显示旧数据与新数据混合,但 Line2D.get_data() 显示旧数据已被删除。为什么图表仍然显示旧数据?