I am getting unwanted margin horizontally on my li a elements when I put a comment next to the code in the .html file. When I remove it, the margin goes away. What is going on, and is there a way I can add comments without affecting the display? Here is the code, where the comment is in the li rule:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name=”viewport” content=”width=device-width”>
<title>Test Navigation</title>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
background-color: white;
position: absolute;
}
li {
display: inline-block; <!--allows you to display like an inline but you can add width and height-->
float: left;
border: 1px solid red;
}
li a {
display: block;
font-size: 1.3rem;
text-align: center;
min-width:140px;
height: 50px;
line-height: 50px;
border: 1px solid black;
}
</style>
</head>
<body>
<ul>
<li><a class="active" href="#" >HOME</a></li>
<li><a href="#">VIDEOS</a></li>
<li><a href="#">DOCUMENTS</a></li>
<li><a href="#">SCTE</a></li>
<li><a href="#">TRAINING</a></li>
<li><a href="#">EVENTS</a></li>
</ul>
</body>
</html>