Navigation bar conflicts with body background position absolutecss

  css, html, javascript

i have a css problem that is blocking my progress, i am an amateur in html and css, and i need the help of a veteran.

The problem is to put the background in the absolute position, so that the background does not expand to the sides, but I create a casual navigation bar, and it conflicts with the absolute position of the background and it is strange, is there any way to solve this?

PRINT:PRINT1
PRINT:out screen
PRINT:As you can see, the navbar is back to normal, but the background is clumsy, that’s why I’m breaking my head, is there any way to make a navbar with a background in "body" with absolute position?

Full HTML Code:

<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Forbidden Series</title>
    
<link rel="stylesheet" type="text/css" href="css/estilos.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,[email protected],600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>
    
    <!--logo-->
    <header id="forbiddenlogo"><h1><font color="#600103">Forbidden</font> <font color="#FFFFFF">Series</font></h1></header>
        
    <!--navbar-->
    <nav id="navbar">
        <ul>
            <li><a href="#home">Home</a></li>
            <li><a href="#loja">Loja</a></li>
            <li><a href="#staff">Staff</a></li>
            <li><a href="#eventos">Eventos</a></li>
            <li><a href="#login">Login</a></li>
            </ul>
    </nav>
    
    <!--container-->
    <div id="container">
    
    </div>
</body>
</html>

FULL CSS CODE FROM MY SITE:

/* CSS Document */

@font-face{
    font-family: "8 Bit Madness";
    src: url("../fonts/8-Bit Madness.ttf");
}

@font-face{
    font-family: "8 BIT WONDER";
    src: url("../fonts/8-BIT WONDER.TTF");
}

body{
    position: absolute;
    padding: 0;
    margin: 0;
    background-image: url("../img/Screenshot_1.png");
    background-repeat: no-repeat;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

#container{

}
    
#navbar{
    position: relative;
    background-color: black;
}

#navbar ul{
    
}

#navbar ul li{
    display: inline;
}

#navbar ul li a{
    
}

#forbiddenlogo{
    position: relative;
    font-size: 25px;
    font-family: "8 BIT WONDER";
    -webkit-text-stroke: 1px black;
    bottom: 10px;
    left: 30px;
}

#forbiddenlogo a{
    text-decoration: none;
    font-style: normal;
}

Source: Ask Javascript Questions

LEAVE A COMMENT