• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with css

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have following jsp code

Login.jsp




css code





when the Login.jsp loads for the first time, the back ground color is not changed as in style sheet. But if i hit submit the color changes.....

can some one pls tell what mistake i am doing......I am making use of Tomcat 5.x
 
Paul Clapham
Sheriff
Posts: 21559
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what "hitting submit" means in the context of your application. But it is probably connecting to a URL for which the relative pathactually points to your CSS file, and your original URL does not do that.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<link href="../css/styles.css" rel="stylesheet" type="text/css"/>


try this instead:-

<link href="<%=request.getContextPath()%>/css/styles.css" rel="stylesheet" type="text/css"/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic