• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP page Body color not coming green despite specifying in CSS.

 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have specified in the CSS. Despite that color is white only.where am i going wrong?


loginstyle.css



Login.jsp



thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34396
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is "background-color: green; " your entire CSS file? It's supposed to go with a selector like "body".
 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No the entire file is :

loginstyle.css


view plaincopy to clipboardprint?
Note: Text content in the code blocks is automatically word-wrapped
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And are the other two styles in that CSS file doing their work?
 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all.It worked actually but only when I give complete path as



Both login.jsp and loginstyle.css are in the same pages folder inside Web Content.When these are in same folder why cant we write



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both of those approaches, absolute paths as well as page-relative paths are poor ways to specify the path to a resource in a Java web app. See the ServletsFaq for more information on types of paths and why you should be using a server-relative path.
 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I will See the ServletsFaq for more information on types of paths and why you should be using a server-relative path.

But I am curious to know why does specifying link href as"loginstyle.css" does not work because both are in same Pages folder inside the Web Content.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page-relative URLs are relative to the current URL, not the "current folder" (of which there is no real concept). URLs in web apps are mapped, so they don't actually represent any folder structure. So they are fragile and should not be used.
 
Monica Shiralkar
Ranch Hand
Posts: 842
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic