Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 587941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:15:56+00:00 2026-05-13T15:15:56+00:00

I found a very basic web page on the Internet and now I would

  • 0

I found a very basic web page on the Internet and now I would like to do the obvious thing and add some CSS so I can build nicer pages.

  1. How can I include jQuery, as well as other style sheets?
  2. How can I include inline CSS so I can throw in a text-align: center, for example, to try out quick changes?

Regular jQuery include:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"/>

Basic Hello World server without formatting: (Updated to include static routing fix so others will be up and running quicker)


(ns hello-world
  (:use compojure))

(defn index
  [request]
    (html
    [:h1 "Hello World"]
    [:p "This is ugly with CSS!"])
    )

(defn hello
  [request]
  (html ""
   [:title "A very long title"]
   [:div.comment
    [:h1 "Hello's Page"]
    [:p "This would look better with some CSS formatting!"]]
))

(defroutes greeter
  (GET "/" index)
  (GET "/h" hello)
  (GET "/*"
       (or (serve-file "/opt/compojure/www/public" (params :*)) ;; This is needed to find CSS and js files
       :next))
  (ANY "*"
       (page-not-found) ;;  404.html is in /opt/compojure/www/public/404.html
  ))


(run-server {:port 9090}
  "/*" (servlet greeter))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:15:56+00:00Added an answer on May 13, 2026 at 3:15 pm

    You can include style attributes to assign your ‘inline css styles’ using syntax like:

    [:h1 {:style "background-color: black"} "Hello's Page"]
    

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

    (defn hello
      [request]
      (html ""
       [:html
         [:head
            [:title "A very long title"]
            (include-css "my css file")
            (include-js "http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js")]
         [:body
           [:div.comment
              [:h1 "Hello's Page"]
              [:p "This would look better with some CSS formatting!"]]]]))
    

    In order to serve static files like css and js files you will need to change your route statement slightly and add something like:

       (GET "/*"
        (or (serve-file "PATH_TO_FILES" (params :*)) :next))
    

    otherwise, your local css file will never get served.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 300k
  • Answers 300k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer (new Date()).getYear() You should use getFullYear() here. getYear() in JS… May 13, 2026 at 8:02 pm
  • Editorial Team
    Editorial Team added an answer yes both the repository and the factory make sense. a… May 13, 2026 at 8:02 pm
  • Editorial Team
    Editorial Team added an answer jQuery doesn't have a .overlay() function. Are you sure you… May 13, 2026 at 8:02 pm

Related Questions

Trying to avoid re-inventing the wheel here. I have a Google Web Toolkit page
Let me just start out by saying I am completely new to Java web
I'm playing around with Django on my website hosting service. I found out that
[Update] I actually compromised on this problem for now by foregoing the fixed footer
I need to process large image files into smaller image files. I would like

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.