固定导航栏上的位置,使其进入网络中间

i wanna make the navbar is center like the 'my content' please help me to get deal with this. I wanna make the navbar in the center. like the 'my content' used to. But in fact, it literally not center.

加上更正我的设计。像在填充,边距,边框等处

body {
    margin: 0;
    padding: 0;
}

.logo {
    width: auto;
    height: 100px;
}

.container {
    width: 720px;
    height: auto;
    margin: auto;
}

.navbar ul {
    padding: 0;
    text-align: center;
}

.navbar ul li {
    padding: 20px;
    display: inline-block;
    width: auto;
}

.navbar ul li a {
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12px;
    padding: 10px 20px;
    width: auto;
    border: 1px solid black;
    border-radius: 25px;
}

.navbar ul li a:hover {
   border: 1px dashed #2a19c0;
   border-radius: 25px;
   background-color: rgb(68, 99, 236);
   color: white;
}

.content {
    height: 700px;
    background-color: #9360b6;
}

.content h4 {
    text-align: center;
    width: auto;
    padding: 12px;
    text-transform: uppercase;
    text-decoration: underline;
}

.footer {
    background-color: #9360b6;
    height: 30px;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Latihan Layout intermediate</title>
    <link rel="stylesheet" href = "Coffee.css">
</head>
<body>
<div class="container">
        <img src="../image/logo.png" class="logo" alt="logo">
        <div class="navbar">
            <ul>
            <li><a>home</a></li>
            <li><a>price list</a></li>
            <li><a>about us</a></li>
            </ul>
        </div> 
    <div class="content">
        <h4>My content</h4>
    </div>
    <div class="footer">
        <p>Copyright 2020 Alan's web</p>
    </div>
</div>
</body>
评论