gianluca
gianluca

Reputation: 57

how to import less css file into html head

I have a CSS LESS file, and it include css less code. I am trying to import it into my html file, in the head, like so:

<head>
<link rel="stylesheet/less" type="text/css" href="styles.less" />
<script src="less.js" type="text/javascript"></script>
<script src="./script.js"></script>
</head>

However, the css is not processing, and there is no css showing up all just non-css stuff on the html page.

am i importing it wrong?

Upvotes: 3

Views: 618

Answers (1)

Ali Zeinalzadeh
Ali Zeinalzadeh

Reputation: 342

I don't know what's in you less.js file, but in case less.js is a script to compile your less file, you have to put it before the link tag in your head.

<head>
<script src="less.js" type="text/javascript"></script>
<script src="./script.js"></script>
<link rel="stylesheet/less" type="text/css" href="styles.less" />
</head>

Upvotes: 1

Related Questions