LESS files dont't work on dreamweaver CC - css

Is it possible that LESS files don't work in dreamweaver CC? Because probably my syntaxt is correct, but I don't understand why my style.less file doesn't work, even with simple commands like "color: #ff0"

use this in head: make sure you are using rel="stylesheet/less"
<link rel="stylesheet/less" type="text/css" href="styles.less" />
and before the html closing tag
<script src="less.js" type="text/javascript"></script>
Source:
client-side-usage

if you want include less direct to html file you have to read this topic: Less css file include in <head> section
or you can convert .less to .css file: http://koala-app.com/
or you can use gruntJS: http://gruntjs.com/

It's working if I put the entire project inside the "local server folder" (xampp in this case) even if I 'm using only simple html tag, .js and .less file. No php, mysql and others.
Could you tell me why of this behaviour?

Related

Bootstrap file is not being accessed in php file

My bootstrap css file is located at
C:\Users\SCEA\Downloads\bootstrap-3.3.7\css
and for linking this to my php file I have given absolute path as:
<link href="C:\Users\SCEA\Downloads\bootstrap-3.3.7\css" rel="stylesheet">
but the effect of css is not visible.Is my css file not getting linked?
You might have a typo before css. The backslash before it might need to be a period.
<link href="C:\Users\SCEA\Downloads\bootstrap-3.3.7.css" rel="stylesheet">
If are running server in your local computer I suggest moving this file within the server document root.
Your comment:
css is a folder inside bootstrap-3.3.7
Probably in the CSS folder are the actual css files.
You need to refer to the actual CSS files and not to the folder itself.
Here is a quickfix using CDN:
Put these links in and it works guaranteed

how to use less with bootstrap?

there are 3 files, less.js, style.less and style.css. I so far don't understand what the less.js do. Do I need to include it in somewhere? and for style.less, I know I should write less in it and it compile to my style.css, but should I included it in my index.html?
I don't understand the guide in less.org.
First off you don't need to use less in order to use Twitter Bootstrap. The idea behind less to have smaller style sheet files. And Being that Bootstraps css is so large, less helps mitigate that issue. Now about the files you mentioned.
Browsers don't understand *.less files. less.js, in this context, serves as the "compiler"
for the *.less files
Start from the website:
Link your .less stylesheets with the rel set to “stylesheet/less”:
<link rel="stylesheet/less" type="text/css" href="styles.less" />
Then download less.js from the top of the page, and include it in the element of your page, like so:
<script src="less.js" type="text/javascript"></script>
End from the website
They mention compiling the *.less into a proper css. What they should have elaborated somewhere on the site is "Why compile less?"
Like all code, less will require debugging
Running it through a command line compiler can find errors that less.js can't
less.js is an additional file and processing load that is put on the browser. Hence compiling *.less into *.css can make for a faster browsing experience
The Bootstrap gives you the option of choosing either css or less

In eclipse dynamic web project, how to link css to jsp file in webcontent folder

In Eclipse, I created a Dynamic Web Project and a JSP file under WebContent folder. I also created a CSS file under the WebContent folder. Then I use <link rel="stylesheet" type="text/css" href="XXX.css"> in the JSP to link to the CSS file but when I run on web server (Tomcat) the CSS didn't apply. Can someone tell me why?
You must put your web project name before the address path of your css file
Example:
<link rel="stylesheet" href="/YourProjectName/XXX.css" type="text/css">
or in more dynamic way:
<link rel="stylesheet" href="${pageContext.request.contextPath}/XXX.css" />
Have fun :)
You can use: With style.css file in WEB-INF/jsp folder
<style type="text/css">
<%#include file="css/style.css" %>
</style>
NOTE
This however copies the entire source of the CSS file into the HTML
output of the JSP page. In other words, this is a server-side include,
not a client-side resource reference. So you effectively miss the
advantage that the browser can cache static resources and this way you
end up with a bandwidth waste because the very same CSS file is
embedded in every single page. In other words, a bad idea in terms of
performance and efficiency.
as #BalusC described in comment! you want to test your style.css file anyway, this is a solution.
you can use
<link rel="stylesheet" type="text/css" href="path/css">
You should restart eclipse so that it maps all css and javascript files again.
I worked for me.

How to display CSS files in Django blog?

i'm very confused about how to add css files to a blog a made on django following this tutorial: http://www.programmersbook.com/page/21/Django-Beginner-Tutorial-Part-I/
Basically, i want to add a css style sheet to my blog. I've looked around a bit and seen somethings about static and media files and urls. I read a bit about them on Django's website but coulnd't fully understand them.
So, could anyone kindly tell me how i should display:
<link rel="stylesheet" type="text/css" href="style.css" />
They styles work when i do it internally, but how do i show external stylesheets?
It's right in the Django docs, check here. Follow the instructions there and you will be able to use something like that:
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}style.css" />
EDIT:
You should sepearate you "static" files from your templates. So move all your .css, .js and images to one directory in your app (it's default name is /static). Honestly, everything is written in the link provided.

css javascript image in django

Maybe this question has been asked a lot,
but I still can't understand how to load CSS files when using django...
Please can anyone explain to me step by step how to load it?
Can I load the CSS file without the static folder or link, so I don't need to change the urls.conf but just setting in "setting.py" file?
(Sorry if my English is bad") :(
on local machine: you have to add:
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
on a server you don't (and more you shouldn't for security reasons) need the previous line.
So finally: here is my architecture:
project/
app1/
__init.py__
views.py
public/
site_media/
js/
example.js
css/
example.css
in my settings.py:
MEDIA_ROOT = '/thecompletepath/public/site_media/'
MEDIA_URL = '/site_media/'
and in my templates, i use:
<link rel="stylesheet" type="text/css" href="/site_media/css/example.css" media="screen" />
Just add a normal link tag to your template.
<link rel="stylesheet" type="text/css" href="http://example.com/path/to.file.css">
Unless you have a dynamic CSS file, you would not want to have it related to anything in urls.py. Likewise, if you're not using the media (static) folder, you don't need to change anything in settings.py. Just insert it into your HTML in the template.
If you don't want to use an external CSS file, of course, you can always just put <style> tags into your templates.

Resources