WD 10. Ids&Classes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ids and classes in HTML</title>
</head>
<body>
<h3>Ids and classes in HTML</h3>
<div id="mainBox" class="redBg">
this is mainBox
</div>
<span class="redBg"></span>
<!-- Emmet -->
<!-- . is for class and # is for id -->
<span class="redBg"></span>
<span id="mainSpan"></span>
<div class="redBg blackBorder anotherClass"></div>
<!-- Emmet takes div tag as default -->
<div class="blackBackGround"></div>
<!-- Creating multiple elements using emmet-->
<!-- span.myclass.myclass2.myclass3*4 + <tab> to print 4 similar elements using Emmet-->
<span class="myclass myclass2 myclass3">First</span>
<span class="myclass myclass2 myclass3">Second</span>
<span class="myclass myclass2 myclass3">Third</span>
<span class="myclass myclass2 myclass3">Fourth</span>
</body>
</html>
#Output:
Comments
Post a Comment