html - 如何显示天气图标

标签 html css

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

我的文件夹结构如下:

  • CSS
    • 天气图标-wind.min.css
  • 字体
    • weathericons-regular-webfont.eot
    • weathericons-regular-webfont.svg
    • weathericons-regular-webfont.ttf
    • weathericons-regular-webfont.woff
    • weathericons-regular-webfont.woff2
  • index.html

index.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>

最佳答案

您需要包含 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>

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

相关文章:

java - 使用 JSoup 抓取 Google 天气结果

html - Bootstrap 网格列不下降

html - 需要将图像放在页面中间,但文字放在后面

javascript - 导出 <SVG> 时文件损坏

css - 即使高度可能与纯 css 不同,也要在两列中 float 左侧内部 div

javascript - 将 HTML 表格数据发送到表单

html - 页眉和页脚之间的中心内容区域

javascript - 显示图像,该图像在作为服务器运行时在类型文件中输入,但未在浏览器中显示

angularjs - 使用 HTML5 indexedDB 存储多个对象

javascript - 尝试使用 Angular 交换 ng-click 和 ng-class 上的类时图像消失