I have two pieces of similar code-
Code snippet 1-
<div class="section-2">
<div class="about">
<h1 style="text-align: center;margin-top: 50px;">ABOUT</h1>
<hr style="height:5px;width:5%;border:none;color:#333;background-color:#333;" />
</div>
</div>
Code snippet 2-
<div class="section-3">
<div class="projects">
<h1 style="text-align: center;margin-top: 50px;">PROJECTS</h1>
<hr style="height:5px;width:5%;border:none;color:#333;background-color:#333;" />
</div>
</div>
As you can see,the margin-top styling of the h1 tag doesnot work in snippet 2. Why is this happening?
Note:- No css styling has been applied to any of the divs.