troubleshooting Question

CSS File not Working

Avatar of billy21
billy21 asked on
CSSHTMLJSP
5 Comments2 Solutions608 ViewsLast Modified:
I have a JSP servlet that builds an HTML page that is linked to a CSS file.

For some reason the css file is not being picked up when the page is built.

The HTML produced by the servlet is as follows:

<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' type='text/css' href='PropertyMain/Main.css'>
<title>Property Details</title>
</head>
<body>
<h1>Property Details</h1>
<form>
<table align='center'><tr><td align='center'>
<table><tr><td valign="top">
<table><tr>
<td width='100px'>Location:</td><td width='100px'><select class='dataEntry'><option value='Australia'>Australia</option></select></td></tr>
<tr><td>Sub-Location:</td><td><select width='100px'><option value='Queensland'>Queensland</option></select></td></tr>
</td>
</tr></table>
<td valign="top">
<table><tr>
<td>Username:</td><td><input type='text' name='txtUsername'></td></tr>
</tr></table>
</td>
<td valign="top">
<table><tr>
<td>Username:</td><td><input type='text' name='txtUsername'></td></tr>
</tr></table>
</td></tr></table>
</td></tr></table>
</form>
</body>
</html>

The CSS file (Main.css) looks like this:

/* 
    Document   : Main
    Created on : 29-Mar-2013, 18:32:01
    Author     : Win764
    Description:
        Purpose of the stylesheet follows.
*/

root { 
    display: block;
}

input {
    width: 900px; background-color: blue;
}

body {
  background: #eeeeee;
  font-family: “Trebuchet MS”, Verdana, Arial, serif;
}

The css file is in the same folder (PropertyMain) as the servlet class.

PropertyMain is a folder one level above the root directory.

Any ideas?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros