首页 > 解决方案 > 如何显示天气图标

问题描述

我目前正在尝试整合天气图标。但是,如果我嵌入所有内容并将其插入到我的 HTML 中,则不会显示任何图标。以下是我的文件夹结构和 index.html。

我的文件夹结构如下:

索引.html:

<!DOCTYPE html>
<html lang="de">
<head>
    <title>weather</title>
    <link rel="stylesheet" href="css/weather-icons-wind.min.css">
</head>
<body>
    <h1>testgt</h1>
    <i class="wi wi-day-sunny"></i>
</body>

标签: htmlcss

解决方案


您需要包含weather-icons.css文件而不是weather-icons-wind.css

看到这里,它工作正常。

<!DOCTYPE html>
<html lang="de">
<head>
    <title>weather</title>
    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.9/css/weather-icons.css">
</head>
<body>
    <h1>testgt</h1>
    <i class="wi wi-day-sunny"></i>
</body>


推荐阅读