In this exercise I was curious to learn how the first-child selector works. Trying to select the h1
tag and give it a color for example.
.col1:first-child {
color: green;
}
<div class="col1">
<h1> This is something awesome!</h1>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorlike).</p>
<button type="button" class="button">Click Me!</button>
</div>
Note: The question relates only to the first-child and how it actually works, as I think that the h1
is the first child of div col1 but with no effect.