1

I have an html like this all I have included all the files in to my folder. I tried to add some 'less' css attributes in to my main.css file but it is not reflecting in my browser I have added like this. p{color:red;} Any help will be really appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Less Learning</title>
        <link rel="stylesheet/less" href="css/main.less"
        type="text/css" />
        <script src="less/less-1.4.1.min.js"></script>
    </head>

    <body>
        <p>asdasdasd</p>
    </body>

</html>
Arturs
  • 1,258
  • 5
  • 21
  • 28
Yavana
  • 411
  • 1
  • 4
  • 11
  • Did you get the javascript from lesscss.org? and does the browser load the js and css-files? – Razz Aug 30 '13 at 09:43
  • and inspect the page with chrome or something, see what console says and how the css looks. – kangoroo Aug 30 '13 at 09:44
  • seems to be fine http://plnkr.co/edit/Fsiy4ZTpcVW7SZmmTx1X?p=preview check whether the less.js file is present – Arun P Johny Aug 30 '13 at 09:45
  • 1
    I got the solution It will work only in servers like localhost or something. – Yavana Aug 30 '13 at 09:47
  • @sujithcp If you want to use less via client-side, then work on the `.less` files, and not in the `.css` files. Based on what you said above, I think you are doing the modification in your `main.css` file. If that's the case, of course it will not reflect the changes to the browser because your `link` tag is linked to `main.less` – GaryP Aug 31 '13 at 00:45

2 Answers2

1

You still can use less.js with local test files, see for example: less.js not working in chrome

In summary:

  • For Webkit-based browsers (Chrome, Safari, Opera15+) use -allow-file-access-from-files command line option
  • For Opera12 set "Allow File XMLHttpRequest" config flag
  • Firefox should work w/o any special settings.
Community
  • 1
  • 1
seven-phases-max
  • 11,765
  • 1
  • 45
  • 57
-1
  1. Check it in latest browsers like IE10, Firefox,chrome etc., If it is still not working upload the file into the FTP server or configure the site in IIS server.
Yuvaraj P
  • 2,067
  • 3
  • 15
  • 12