• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Frage Ganze Zeile in eine Farbe

MapHD

Neues Mitglied
Ich möchte die ganze Zeile und auch bis oben mit schwarz als Hintergrund sein.
<div style="position: fixed;margin-left:600px;background-color: black"><h3>

<a href="index.html"style="text-decoration:none; color: green">Startseite |</a>
<a href="htmltutorial.html"style="text-decoration:none; color: green">HTML |</a>
<a href="blog.html"style="text-decoration:none; color: green">Blog |</a>
<a href="Kontakt.html"style="text-decoration:none; color: green">Kontakt</a> </h3>
</div>
 
Werbung:
Also was du mit "ganzer Zeile" meinst leuchtet mir ein. Setze dazu deinen div-container auf width: 100%;
Aber was meinst du mit "auch bis oben"?
Hast du einen kleinen Rand oben und unten? Dann schreibe in deinen style-Tag oder in dein CSS-File:
HTML:
* {
   margin: 0;
   padding: 0;
}
 
Werbung:
Versuch es mal so:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
<style>
html, body {
margin: 0px;
padding: 0px;
}
nav {
position: fixed;
left: 0px;
right: 0px;
top: 0px;
background-color: black;
text-align: center;
}
nav a {
text-decoration: none;
color: green;
margin: 0px 5px;
}
</style>
</head>
<body>
<nav>
<h3>
<a href="index.html">Startseite |</a>
<a href="htmltutorial.html">HTML |</a>
<a href="blog.html">Blog |</a>
<a href="Kontakt.html">Kontakt</a>
</h3>
</nav>
</body>
</html>
 
Zurück
Oben