0

I tried a normal test project to check if CSS is applying to the JSP page. But, no matter where I put my css file in the hierarchy, it is not working. Where to place the css file and how to include the tag in JSP?

this is my Project hierarchy

I wrote a simple

    <link href="css/grayscale.css" rel="stylesheet" type="text/css" />

to include css file.

my css file only consists of a test style to change paragraph style.

Please Help :(

1 Answer 1

1

In the same location of your JSP file, create a CSS directory (named css) in which you create your CSS file. To access it try using "/css/grayscale.css"

Sign up to request clarification or add additional context in comments.

3 Comments

Try ../css/grayscale.css
Nope :/ Is there anything I should add in my dispatcher servlet?
I don't see any relation between the dispatcher servlet and the css, but it may be the cause...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.