What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

How to fix the navbar on top

EnneBoh

New member
Joined
Jan 30, 2023
Messages
2
Reaction score
0
HTML Coins
0
hi, im new at programming and im creating a site for a school assignement, i'm trying to create a navbar that dont scroll whit the page, but if i use the attribute "position: fixed" it create the this 1675101288672.png
the black thing its not centered and not like this:
1675101397748.png

the HTML is this:
<!doctype html>
<html lang="it">
<head>
<title>Sicurezza Informatica</title>
<link rel="icon" href="Foto/logo (2).png">
<link rel="stylesheet" type="text/css" href="Pagina 1.css">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Cherokee:wght@300&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@500&display=swap" rel="stylesheet">

</head>
<body style="background-color: #4F8EAD;">
<header style="background-color: #242424;" >
<img src="Foto/logo.png" alt="logo" width="180" class="logo">
<nav>
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#malware come difendersi">Video</a></li>
<li><a href="#cosa fare">Cosa Fare</a></li>
</ul>
</nav>
<button>Accedi</button>
<hr>
</header>
<br>
<p style="text-align: center;">I <b>Malaware</b> sono software malevoli capaci di intrufolarsi nei computer, nei dispositivi mobile e nelle reti aziendali per <b>rubare dati personali</b>, spiare le vittime e danneggiare i sistemi infetti. Ecco come riconoscerli e come adottare le necessarie contromisure per prevenire un' infezione e difendersi da un possibile attacco</p>
<br>
<div style="text-align: center" >
<img width="50%" style="border-radius: 2%" alt="Hacker" src="Foto/hacking-2964100.jpg" title="Sicurezza informatica">
</div>
<br>
<br>
<p style="text-align: center;">Ecco un <b>video</b> per capire come eliminare tutti i <b>virus</b> presenti sul pc</p>
<br>
<div style="text-align: center; border-radius: 50%;">
<video id="malware come difendersi" style="text-align: center;" width="50%" controls>
<source src="Come RIMUOVERE QUALSIASI VIRUS dal computer.mp4" type="video/mp4">
</video>
</div>
<br>
<p style="text-align: center;" id="cosa fare" >Ed ecco 10 Semplici passaggi per proteggersi</p>
<ul class="10 cose">
<li>1. Utilizzare un software antivirus e mantenerlo sempre aggiornato.</li>
<li>2. Utilizzare un firewall per proteggere il proprio sistema dalle connessioni non autorizzate.</li>
<li>3. Utilizzare un software anti-spyware per rimuovere eventuali software spia presenti sul sistema.</li>
<li>4. Non aprire allegati di posta elettronica o link sospetti, anche se inviati da fonti conosciute.</li>
<li>5. Fare attenzione ai siti web che si visitano e non accedere a siti sospetti o che richiedono informazioni personali.</li>
<li>6. Utilizzare un browser web sicuro e mantenerlo sempre aggiornato.</li>
<li>7. Utilizzare una rete privata virtuale (VPN) per proteggere la propria connessione quando si utilizza una connessione wireless pubblica.</li>
<li>8. Utilizzare un software di crittografia per proteggere i propri dati.</li>
<li>9. Tenere sempre una copia di backup dei propri dati importanti.</li>
<li>10. Tenere sempre il sistema operativo e le applicazioni aggiornate con gli ultimi aggiornamenti di sicurezza.</li>
</ul>
<p style="text-align: center;">Ricorda che la <b>sicurezza informatica</b> è un processo in continuo evoluzione, quindi è importante rimanere sempre informati sui nuovi rischi e sulle ultime tecniche di difesa.</p>
<br>
</body>
</html>




and the css this:
body{
text-align: center
}

ol{
font-family: 'Noto Sans Cherokee', sans-serif;
font-size: 100%;
}
h3
{
font-family: 'Noto Sans Cherokee', sans-serif;
font-size: 120%;
}
p
{
font-family: 'Noto Sans Cherokee', sans-serif;
font-size: 100%
}
a
{
font-family: 'Noto Sans Cherokee', sans-serif;
font-size: 100%

}
h1 {
font-family: 'Roboto Mono', monospace;
color: chocolate;
font-size: 300%;
}
ul {
list-style-type: none;
font-family: 'Noto Sans Cherokee', sans-serif;
}


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

.menu,
a,
button {
font-family: 'Montserrat', sans-serif;
font-weight: 300;
font-size: 14;
color: white;
text-decoration: none;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30px 10%;
color: #242424;
}
.menu {
list-style: none;
}
.menu li {
display: inline-block;
padding: 0px 20px;
}
.menu li a {
transition: all .3s ease;
}
.menu a:hover {
color: #39f;
}
button {
padding: 9px 25px;
background: #0d94a6;
border: none;
border-radius: 50px;
cursor: pointer;
transition: all .3s ease;
}
button:hover {
background: #39f;
}








please help me i dont know how to do it
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back