/* General */
body{
background-color: #000000;
}
/* ------- */
/* 1.0 - Menu de navegación */
#menu{
list-style-type:none;
margin:0;
padding:0;
}
#menu li{
float: left;
}
#menu li:first-child > a{
background-color:gray;
}
#menu li a{
background-color: black;
color: white;
padding: 16px 16px 16px 16px;
display:block;
font-family: monospace;
text-decoration:none;
border-bottom: 2px solid white;
}
#menu li a:hover{
background-color:gray;
}
/* ------------------------- */
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Astro cosmos</title>
<link href="https://necolas.github.io/normalize.css/7.0.0/normalize.css" rel="stylesheet" type="text/css">
</head>
<body>
<ul id="menu">
<li><a href="home.html">Inicio</a></li>
<li><a href="maths.html">Matemáticas</a></li>
<li><a href="physics.html">Física</a></li>
<li><a href="computacion.html">Computación</a></li>
<li><a href="others.html">Otros</a></li>
</ul>
</body>
</html>
How could I make the horizontal size of the menu be the size of the body, that is, adaptable to any window. Only with CSS