My website is experiencing overflow on the x axis, even though all vw/width properties are set to 100. I suspect that the .logout element may be causing this issue, but I'm not sure what exactly needs to be modified to resolve it. Any assistance would be greatly appreciated!
/* GLOBAL */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: monospace;
}
header {
position: relative;
}
/* MAIN */
.logo {
position: absolute;
top: 25px;
left: 40px;
font-weight: 800;
font-size: 2.5rem;
}
.container {
background-color: black;
width: 100vw;
height: 100vh;
}
/* NAVBAR */
.nav {
width: 100vw;
height: 80px;
background-color: #5f7866;
}
.navbar {
position: absolute;
top: 30px;
left: 40%;
}
.items {
display: flex;
list-style: none;
}
.item {
font-size: 2rem;
margin-left: 20px;
color: black;
font-weight: lighter;
transition: 0.2s;
}
.item:hover {
transition: all 0.1s ease;
transform: scale(0.98);
border-bottom: 1px solid white;
}
.links {
display: inline-block;
text-decoration: none;
color: black;
}
.logout {
position: absolute;
font-size: 2rem;
border: 2px solid #49e31b;
background-color: transparent;
border-radius: 20px;
padding: 10px 10px 10px 10px;
top: -10px;
left: 600px;
transition: 0.3s;
color: black;
display: inline-block;
text-decoration: none;
overflow: hidden;
}
.logout:hover {
background-color: #49e31b;
cursor: pointer;
transform: scale(0.98);
}
<!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">
<link rel="stylesheet" href="{% static 'css/index.css' %}">
<title>{% block title %} {% endblock title %}</title>
</head>
<body>
<header class="nav">
<h1 class="logo">Art Showcase</h1>
<div class="navbar">
<ul class="items">
<li class="item">
<a class="links" href="{% url 'home' %}">Home</a>
</li>
<li class="item">
<a class="links" href="{% url 'about' %}">About</a>
</li>
<li class="item">
<a class="links" href="{% url 'register' %}">Register</a>
</li>
<li class="item">
<a class="links" href="{% url 'login' %}">Login</a>
</li>
</ul>
<div>
<a class="logout "href="{% url 'logout' %}">Logout</a>
</div>
</div>
</header>
<div class="container">
{% block content %}
{% endblock content %}
</div>
</body>
</html>