clojure - Getting started with CSS in Compojure? -


I have found a very basic web page on the internet and now I would like to talk clearly and add some CSS so that I get good pages Can build.

  1. How can I include jQuery, as well as other style sheets?
  2. How can I include inline CSS so that I

are regularly included in jQuery:

  & Lt; Script type = "text / javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" />  

the default Hello World server without formatting: (updated to include fixed routing fixes so others will increase and speed up)

  (ns hello-world (use composer)) ( Defn index [request] (html [: h1 "Hello World"] [: P "It's ugly with Season!"]) (Hello [Request] (HTML "" [Title: "Very Long Title"] [: div .comment [: h1 "hello page page"] [: p "This is bad If you want to see some CSS formatting! "]])) (Defrites Greater (GET / Index) (GET" / H "Hello) (GET" / * "(or (service file" / opt / composer / www / public "( Params: *)) ;; This is necessary to find CSS and JS files: Next)) (Any "*" (Page-Not Found); 404.html / opt / compojure / www / public / 404 (Run-server {: port 9090} "/ *" (servlet greeter))  

You can include style attributes in your 'inline CSS Styles' to use syntax:

  [: h1 {style: "background-color: black"} "hello page"]  

You can also include a stylesheet tag and javascript by using included -css and included-js functions.

  (defl hello [request] (html "" [: html [: head [: title "very long title"] (included-css "my css file") (included- js " Http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js ")] [: body [: div.comment [: h1" hello page "] [: p" This is some CSS formatting To serve stable files like CSS and JS files, you will need to change your root statement to a little bit. More must be added: 

  ("(* / *" (or service file "PAT Otherwise, your local CSS file will never serve. 


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -