首页 > 解决方案 > 为什么我的浏览器无法显示我的语义 UI CSS 表单

问题描述

我正在创建一个表单并在我的 localhost 上使用 3000 端口提供它。

一切正常,除了我的浏览器无法在我的浏览器中显示 CSS 代码并且我收到此错误

Refused to apply style from 'http://localhost:3000/Semantic-UI-master/dist/semantic.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

发生了什么?当我单击 html 文件时,CSS 正在工作。我感到很困惑

标签: semantic-ui

解决方案


尝试使用以下代码段

<link
  rel="stylesheet"
  type="text/css"
  href="http://localhost:3000/dist/semantic.min.css"
/>

您似乎试图将样式表包含在text/html


推荐阅读