Friday, 3 February 2017

CSS Selectors

ID Selector:-

<html>
<head>
<style>
#styl
{
color:blue;
margin-left:100px;
text-size:large;
}
</style>
</head>
<body>
<div>
<p id=styl>This is the example of ID selector.</p>
</div>
</body>
</html>

output:-







Class Selector:-

<html>
<head>
<style>
.styl
{
color:red;
margin-left:100px;
text-size:large;
}
</style>
</head>
<body>
<div>
<p class=styl>This is the example of Class selector.</p>
</div>
</body>
</html>

output:-







Id selector:- An ID selector is used to identify by using # symbol. You can apply only a single ID on one element.

Class Selector:- Class selector is defined by using a dot(.). You can apply multiple classes on single element.









No comments:

Post a Comment

Insert, Delete, Update Using Entity Framework and LINQ in ASP.NET 1> Create Database First 2> Create Table 3> Add ADO...