SPGuar
SPGuar

Reputation: 413

How do I link a CSS folder and an image folder in Eclipse?

I have a directory like this in Eclipse:

SimpleServletProject
     webontent
       >> images
           sep2.jpg
           etc.
       >> css
       >> MetaINF
       >> WebINF
            index.html
            login.html

The images and CSS are two folders where the images and CSS files are kept. In the CSS folder I have a login.css file.

I want to give the path of the image which is in images folder. The css code is:

background-image:url("/images/sep2.jpg");

What should be the path?

Upvotes: 0

Views: 3834

Answers (2)

R Shah
R Shah

Reputation: 171

Please try following in your css file. This should work for you.

background-image: url("../images/sep2.jpg");

Upvotes: 1

user1573733
user1573733

Reputation: 13

Try to use background: url("/images/sep2.jpg"); instead. That should give you the correct path for your project. Otherwise we need some more code to identify the problem

Upvotes: 0

Related Questions