0

I am creating a dynamic web application in eclipse. which contains the following project structure.

enter image description here

Here i have two html pages in WebContent folder and css,images folders. I have one css file for two html pages.Here this css is applying only for index page ,it is not applying for admin page.

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

I have added the above line in index and admin pages but,it is applying only for index page ,it is not applying for admin page.

Can any please help me.

4
  • Can you post the content from the .project file and the code for the admin.html page? Commented Oct 29, 2015 at 5:56
  • 1
    This should be added in the header of your pages - one page works but other page is not working, so I suspect it's not included in header. Commented Oct 29, 2015 at 5:56
  • I added link statement with in head tag only. even though it it is not working for admin page. Can i have multiple html pages in Web Content folder. Commented Oct 29, 2015 at 6:06
  • @Asha, yes you can! Do you mind posting some codes from the 3 files? Commented Oct 29, 2015 at 6:11

3 Answers 3

1

You can try below path for css. As your index file is in WEB-INF folder, you need to come out of it first, then you need to enter into the css folder. Hopefully, it will work.

<link href="./css/stylesheet.css" rel="stylesheet" type="text/css" />
Sign up to request clarification or add additional context in comments.

1 Comment

the index.html file is not in WEB-INF! Also, to access parent directory, you need to use "../css/stylesheet.css" (double dots). So, basically, your code is same as that in the question, and should work! Two mistakes got nullified there! :P
0

In your HEAD, add this might be worked:

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

Comments

0

For eclipse working directory always follow this syntex-

/ Project_Name / Folder_Name / File_Name.extension

so try these in your project for css, images respectively-

/brightsymphony/css/stylesheets.css
/brightsymphony/images/logo.png

Comments

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.