html - 图标不显示

标签 html css

我正在构建一个简单的网页。文本显示正确,但图标未显示。图标来自 ionicons 框架。

我检查了这个 css 文件中的 ionicons.min.css 路径和图标名称

我的 html 文件:

<!--DOCHtml5-->
<html lang="en">
<head>
    <meta charset="utf-8">
    <link href="style.css" type="text/css" rel="stylesheet">
    <title>webpage</title>
    <link href="https://fonts.googleapis.com/css?family=Euphoria+Script" rel="stylesheet"> 
    <link href="https://fonts.googleapis.com/css?family=Montez" rel="stylesheet"> 
    <link href="icons/ionicons.min.css" rel="stylesheet" type="text/css">
</head>
<body>
    <div class = "name">
        Name
        <ul class = "social-icons">
            <li><i class="ion-arrow-right-a"></i></li>
        </ul>
    </div>   
</body>
</html>

我的 CSS 文件:

*{
    margin:0;
    padding:0;
    font-family: 'Euphoria Script', cursive;
    font-size: 100px;    
}

body{
    height:100vh;
    margin: 0;
    padding: 0;
    background-color: #ef6758;
}

.name{
    position:absolute;
    top:35%;
    left:31%;
    font-family: 'Montez', cursive;
    color: #4be214;
}

.social-icons li{
    list-style: none;
}

图标应该是可见的

最佳答案

通过它。它对你有用,因为在你的 css 中找不到字体系列文件

*{
    margin:0;
    padding:0;
    font-family: 'Euphoria Script', cursive;
    font-size: 100px;    
}

body{
    height:100vh;
    margin: 0;
    padding: 0;
    background-color: #ef6758;
}

.name{
    position:absolute;
    top:35%;
    left:31%;
    font-family: 'Montez', cursive;
    color: #4be214;
}

.social-icons li{
    list-style: none;
}
<!--DOCHtml5-->
<html lang="en">
<head>
    <meta charset="utf-8">
    <link href="style.css" type="text/css" rel="stylesheet">
    <title>webpage</title>
    <link href="https://fonts.googleapis.com/css?family=Euphoria+Script" rel="stylesheet"> 
    <link href="https://fonts.googleapis.com/css?family=Montez" rel="stylesheet"> 
    <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css">
</head>
<body>
    <div class = "name">
        Name
        <ul class = "social-icons">
            <li><i class="ion-arrow-right-a"></i></li>
        </ul>
    </div>   
</body>
</html>

关于html - 图标不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55351705/

相关文章:

python - django 从文件导入模板

javascript - "setTimeout(functon(){//do stuff},0)"是否会为其包含的函数导致微小的执行延迟?

javascript - 正则表达式提取字符串的前 10 个字符

javascript - jQuery UI 选项卡不起作用

css - 底部内容在ie7中用阴影隐藏

javascript - 如果当前存在,如何更改内部链接的样式

html - 上传到服务器时不显示背景图像

javascript - 如何在javascript中向上键的文本字段中的两位数字后添加点?

html - 是什么导致我的水平滚动条

jquery - 随着原始 div 的更改,div 的克隆也随之更改