Hello-World Hello-World - 3 years ago 288
Less Question

Why LESS css does not work on localhost

According to this tutorial my less code should work but it doesn't.

Can you please help me to get my less css to work.

Right now it does not working - Page loads with no applied styles. What am I doing wrong?

The error is:

FileError: 'localhost:1/styles.less' wasn't found (404) in styles.less

But it is there in the root?


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<link rel="stylesheet/less" type="text/css" href="styles.less">
<script src="_/script/less-1.4.1.min.js" type="text/javascript"></script>



<div id="header">test</div>

<h2>test h2</h2>





@color: red;

#header {
color: @color;
h2 {
color: @color;

Answer Source

Thanks for your help everyone - turns out the answer is that my localhost did not serve the mime type .less

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download