Selector in HTML,CSS
Selectors and shortcut in html css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Selector</title>
<style>
#fisthead{ /* we use # to target id */
color: aqua;
background-color: blue;
}
.paraone{
color: aqua; /* we use . to target class */
background-color: blueviolet;
}
</style>
</head>
<body>
<!--There are different types of selector in HTML CSS
1st is ID , 2nd is CLASS , 3rd is group selector that is not important -->
<h1 id="firsthead">ALI</h1>
<P class="paraone">My name is ali shahid and i am a bscs student</P>
<br>
<p class="paraone">I am doing BSCS from lahore leads university</p>
<!--we use this h1*4 to make this-->
<h1></h1>
<h1></h1>
<h1></h1>
<h1></h1>
<!-- we use .div*4 to make this-->
<div class="div"></div>
<div class="div"></div>
<div class="div"></div>
<div class="div"></div>
<!--we use this div.box$#4--> <!--isma hum ny kha div ki 4 class .box class li or #box id ki or $ iska matlab sab ko numbering dydo-->
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
<div class="box" id="box3"></div>
<div class="box" id="box4"></div>
</body>
</html>
Comments
Post a Comment