5) Grouping Selector
This selector make group of all HTML elements.
No Syntax
<html>
<head>
<style>
h1,p
{
background-color:yellow;
}
</style>
</head>
<body>
<h1>Welcome to My Homepage</h1>
<div>
<p>My name is Donald.</p>
<p>I live in Duckburg.</p>
</div>
<p>My best friend is Mickey.</p>
</body>
</html>
<html>
<head>
<style>
h1, .tagline, #intro
{
font-family:"Times New Roman",Georgia,Serif;
border-style: dotted;
border-color: violet
}
</style>
</head>
<body>
<h1>Welcome to My Homepage - Type Selector - Selects an element by it’s type </h1>
<div id="intro">
<p> I am id Start here </p>
<p class="tagline"> I am class start here and also end here </p>
<p> I am id End here </p>
</div>
</body>
</html>
No comments:
Post a Comment