In various browsers, there exists a default top-margin
on the p
tag. For instance, in Firefox, this default margin is set at 16px (most likely derived from 1em), even before any additional CSS is applied. If you were to adjust the top-margin
to 15px, the difference may not be readily noticeable. However, rest assured that it does take effect - try setting it to 25px (or any value significantly distinct from 16px), or even 0px to observe the absence of top-margin.
In the provided example below, the code has been modified to demonstrate the element minus a top-margin (i.e., set to zero). Upon hovering over it, the top-margin is then adjusted to 15px, showcasing the disparity...
p.ex1 {
margin-top: 0px;
margin-left: 35px;
}
p.ex1:hover {
margin-top: 15px;
}
<div class="footer2">
<p class="ex1"> ABOUT US </p>
<hr>
<div class="footer">
<br>
<p id="top">
<font size="5">Contact us</font>
</p>
</div>