Currently, I am encountering an issue while utilizing the css property margin-top
on <li>
elements.
My goal is to have my list positioned at the top of the page, however, the li
element does not seem to be moving to the top as expected.
Displayed below is my HTML code:
<body>
<div class="main_header">
<h1>Title</h1>
<ul>
<li><a href="/about">About Me</a></li>
<li><a href="/Order">Order</a></li>
<li><a href="/Designs">Designs</a></li>
<li><a href="/Contact">Contact</a></li>
</ul>
</div>
</body>
Here is my CSS code:
.main_header li a {
margin-top: -20px;
display: inline-block;
}