Edit in JSFiddle

<html>
<head>
<title>class selector </title>
</head>

<body>

<h1> Main heading </h1>

<h2 class="myClass">sub heading </h2>

<p class="myClass"> This is a paragraph </p>

</body>

</html>
.myClass
{
  color:red;
}