LESS文件无法加载(404) [英] LESS file does not load (404)
本文介绍了LESS文件无法加载(404)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用IIS 7.5而我无法加载较少的文件,因为它会产生404错误。
I'm using IIS 7.5 and I'm unable to load the less file because it gives a 404 error.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Less Tutorial</title>
<link rel="stylesheet/less" href="style.less" />
<script src="less-1.0.41.min.js"></script>
</head>
<body>
<div id="container">
<a href="#">My Anchor</a>
</div>
</body>
</html>
少:
@primary_color: green;
#container {
width: 200px;
height: 200px;
background: @primary_color;
}
推荐答案
使用Asp.Net时你可以在web.config中添加mime类型:
When using Asp.Net you can add the mime type in your web.config:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".less" mimeType="text/css" />
</staticContent >
</system.webServer>
这篇关于LESS文件无法加载(404)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文