<!DOCTYPE html>
<html>
<head>
<title>Selectors Example</title>
<style>
div.content p {
margin: 10px;
color: green;
}
</style>
</head>
<body>
<div class="content">
<p>Content Styled</p>
</div>
<div class="content">
Content Unstyled
</div>
<p class="content">
Content Unstyled
</p>
<p>
Content Unstyled
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Universal Selector Example</title>
<style>
* {
margin: 0;
padding: 0;
font-size: 12px;
}
</style>
</head>
<body>
<div>
Content Styled
</div>
<p>
Content Styled
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Type Selector Example</title>
<style>
p {
font-size: 16px;
}
</style>
</head>
<body>
<div>
Content Styled
</div>
<p>
Content Styled
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Class Selector Example</title>
<style>
.highlight {
background-color: yellow;
}
</style>
</head>
<body>
<div class="highlight">
Content Styled
</div>
<p id="highlight">
Content Styled
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Class Selector Example</title>
<style>
#header {
color: blue;
}
</style>
</head>
<body>
<div class="header">
Content Styled
</div>
<p id="header">
Content Styled
</p>
</body>
</html>
Element
Description
Example