0

I'm building a website with eclipse / tomcat. In my html file I've included an external css file. When i open my main website page as a file, everything is working fine and it reads the external css file , But when i try to open the main page using tomcat: "MyHost:8080/DBankOnline/MainPage.html" It loads the html but doesn't load the external css file. Why won't it load the external css when trying to open my website from MyHost ?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"               "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="DBankwebsite30.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>DBank - The best bank</title>
</head>

<script src="jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="mainScript17.js"></script>
<style>

#content>p
{
font-size:20px;
font-style:italic;
}
</style>

<body onload="javascript:setInterval(clock,1000);javascript:buttonClicked();">
<div id="main">
<div id="upper">
    <p id="welcomeMessage">Hello guest.</p>
    <div id="login">
        <a href="loginpage.html">&nbsp; &nbsp; Login/Logout</a>
    </div>
</div>

<div id="left">
<div id="hour"></div>
    <ul>
        <li id="MainPage" class="mainButtons"><a href="MainPage.html">- Home -</a><hr></li>
        <li id="Personal" class="mainButtons"><a href="Personal.html">- Personal -</a><hr></li>
        <li id="AboutUs" class="mainButtons"><a href="localHost:8080/MainPage/AboutUsButton.html">- About us -</a><hr></li>
        <li id="ContactUs" class="mainButtons"><a href="localHost:8080/MainPage/ContactUsButton.html">- Contact us -</a><hr></li>
    </ul>
</div>

<div id="content">
    <p> Hello universe </p>

</div>

<div id="bottom"> 
    <p id="rights">The best website</p>
</div>

-thank you

2
  • 1
    Go to your package explorer and refresh. Commented Nov 12, 2013 at 13:22
  • 1
    Probably a path issue... look into how Tomcat interprets paths Commented Nov 12, 2013 at 13:22

1 Answer 1

1

Definitely a path issue. Use chrome browser to inspect elements and see which path your external css file is used by the host then you have a clue. I ran into similar cases before. Not a big issue. Good luck.

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

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.