10 Years
Discussion Span
Last Post by shahpraneel

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


Incorrect order of tag elements, it should be as

<link rel="stylesheet" type="text/css" href="mystyle.css">

also make sure their are in correct directory (in your case together with JSP document)


yes, I have rechecked. . Both files are in same directory.

here is css file

root { 
    display: block;
    font-size: 14px;
  font-style: italic;
  font-weight: normal;
  font-variant: normal;
  color: navy;
  background-color: #ccffcc;
  background-attachment: none;
  font-family: Georgia,'Times New Roman',times,serif;
          <LINK href="style1.css" rel="stylesheet" type="text/css">
        <title>JSP Page</title>
         <h2>Hello World!</h2>


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


Hi Peter.. This problem is solved as I made following changes in jsp

            Welcome... To this style1.       

Thanks a lot for ur help.


you can add the following things inside the <head> tag

<meta http-equiv="Content-Style-Type" content="text/css">
<title> Home </title>
<link HREF="../theme/screens.css" REL="stylesheet" TYPE="text/css" >

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

Votes + Comments
2 ears to late, with answer that doesn't help.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.