user8574635
user8574635

Reputation:

How to apply css in JSP?

 #section>.snb .tit{position:relative;}
    #section>.snb .tit h1{color:#2765b1;font-size:20px;text-indent:25px;}

I am not sure how to apply the css code above to jsp page. It looks different from the basic css with

body { 
    background: #00ff00 url("smiley.gif") no-repeat fixed center; 
} 

kind format.

Upvotes: 0

Views: 799

Answers (1)

Tejendra
Tejendra

Reputation: 159

You can apply like this :

<html>
<head>
<style> 
 #section>.snb .tit{position:relative;}
    #section>.snb .tit h1{color:#2765b1;font-size:20px;text-indent:25px;}

</style>
</head>
<body>



<div id="section">
<div class="snb">
<div class="tit">
<h1>test text</h1>
</div>
</div>
</div>



</body>
</html>

Please refer this it will help you to understand css selectors. In

#section>.snb .tit h1{color:#2765b1;font-size:20px;text-indent:25px;}

it look for h1 tag in element with 'tit' class inside all element's with class value as 'snb' in element with id 'section'.

Upvotes: 1

Related Questions