Professional Documents
Culture Documents
CSS
CSS
CSS
ex.
<head>
<style type="text/css">
.buttonStyle1
{
background-color:black;
color:yellow;
width:100px;
border:double;
border-radius:10px;
}
.headingStyle1
{
background-color:blue;
color:yellow;
border:double;
border-radius:10px;
}
</style>
</head>
Note:
1. the class can be defined using the . symbol followed by any meaniningful name
2. to apply the class in Server control use the CssClass attribute i.e.
3. To apply the class in the html tag use the class attribute
External CSS -
h1 {
background-color: black;
color: yellow;
border: double;
border-radius: 10px;
}
h2 {
background-color: yellow;
color: black;
border: double;
border-radius: 10px;
}
body
{
background-color:cyan;
}
27/09/21
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
/*iD Selector*/
#homebutton
{
background-color:blue;
color:white;
}
/*Group Selector*/
h1,h2,h3
{
color:blue;
}
/*contextual selector*/
p em
{
color:blue;
}
/*compound selector*/
#homebutton:hover
{
background-color:black;
color:yellow;
border-radius:10px;
}
/*attribute Selector*/
input[type="Text"]
{
background-color:white;
}
input[type="Text"]:hover
{
background-color:yellow;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<em>Thanks</em>
</form>
</body>
</html>