This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with css

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • 0
  • 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
Pie
Posts: 20177
25
MySQL Database
  • 0
  • 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
  • 0
  • 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"/>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic