2021-07-29

Even though I reset the margins in css, there is still a space in between. What is the reason?

I reset the margins of all the elements, but there is a gap in between, which I don't know why. I tried it in chrome and firefox browsers. Same result in both. I'm waiting for your help. This is really important enter image description here

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family: Arial, Helvetica, sans-serif;
}

#nav {
    padding: 20px;
}
#menu{
    list-style-type: none;
}

#menu li {
    display: inline-block;
    min-width: 140px;
    padding: 15px;
    text-align: center;
    background-color: rgb(48, 48, 48);
}

#menu li a{
    text-decoration: none;
    color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div id="nav">
        <ul id="menu">
            <li><a href="#">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Courses</a></li>
            <li><a href="#">Contact</a></li>
            <li><a href="#">Links</a></li>
        </ul>
    </div>
</body>
</html>


from Recent Questions - Stack Overflow https://ift.tt/3yb7VQ7
https://ift.tt/eA8V8J

No comments:

Post a Comment