Adding css to JSP

Thread Solved

Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

Adding css to JSP

 
0
  #1
Jul 17th, 2008
Please let me know how to add css to a jsp page?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,190
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Adding css to JSP

 
-1
  #2
Jul 17th, 2008
Exactly as to any other HTML based document, either use internal or external approach.
Last edited by peter_budo; Jul 17th, 2008 at 7:26 am. Reason: typo
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

Re: Adding css to JSP

 
0
  #3
Jul 17th, 2008
Originally Posted by peter_budo View Post
Exactly as to any other HTML based document, either use internal or external approach.

i used ....
<LINK href="style1.css" rel="stylesheet" type="text/css">


in <head> tags but it did't work. Plz help
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,190
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Adding css to JSP

 
-1
  #4
Jul 17th, 2008
Incorrect order of tag elements, it should be as
  1. <head>
  2. <link rel="stylesheet" type="text/css" href="mystyle.css">
  3. </head>
also make sure their are in correct directory (in your case together with JSP document)
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

Re: Adding css to JSP

 
0
  #5
Jul 17th, 2008
yes, I have rechecked. . Both files are in same directory.

here is css file

  1. root {
  2. display: block;
  3. font-size: 14px;
  4. font-style: italic;
  5. font-weight: normal;
  6. font-variant: normal;
  7. color: navy;
  8. background-color: #ccffcc;
  9. background-attachment: none;
  10. font-family: Georgia,'Times New Roman',times,serif;
  11. }
Last edited by peter_budo; Jul 17th, 2008 at 8:32 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,190
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Adding css to JSP

 
-1
  #6
Jul 17th, 2008
Can you please post the JSP file?

PS: Please use code tags here is small help
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

Re: Adding css to JSP

 
0
  #7
Jul 17th, 2008
  1. <html>
  2. <head>
  3.  
  4. <LINK href="style1.css" rel="stylesheet" type="text/css">
  5.  
  6. <title>JSP Page</title>
  7. </head>
  8. <body>
  9.  
  10. <form>
  11. <h2>Hello World!</h2>
  12. </form>
  13.  
  14. </body>
  15. </html>
Last edited by peter_budo; Jul 17th, 2008 at 8:42 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,190
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Adding css to JSP

 
-1
  #8
Jul 17th, 2008
Just did little bit of search on internet and seems to me there is more trouble with use of the root then you want to go through. Just replace it with html or html,body
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

Re: Adding css to JSP

 
0
  #9
Jul 18th, 2008
Hi Peter.. This problem is solved as I made following changes in jsp
..
  1. <form>
  2. <root>
  3. Welcome... To this style1.
  4. </root></form>
Thanks a lot for ur help.
Last edited by Tekmaven; Jul 18th, 2008 at 6:42 am. Reason: Code tags
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JSP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC