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

Div hat Abstand zu Browserrand (oben)

Fabiii321

Mitglied
Hallo zusammen,

ich weiß langsam nicht mehr was ich falsch mache.
Mein div-Container (header) soll einfach direkt oben an den Browserrand-

Hier mein Code:
HTML:
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <link href="style.css" rel="stylesheet" type="text/css" />
  <title></title>
  </head>

      <div id="header">
        <h1>header</h1>
      </div>
 
      <div id="navi">
        test<br>
        test1<br>
        test2
      </div>
 
      <div id="content">
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
</html>


CSS:
body{
background-color: #DED6D6;
margin: 0;
padding: 0;
}
#header{
height:50px;
background-color:green;
text-align:center;
margin-top: 0px;
}



Vielen Dank
Gruß
Fabi
 

Anhänge

  • Unbenannt.png
    Unbenannt.png
    43,3 KB · Aufrufe: 4
HAllo,

oh ja sorry.

Aber das verbessert nichts.

Code:
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <link href="style.css" rel="stylesheet" type="text/css" />
  <title></title>
  </head>
 
  <body>

      <div id="header">
        <h1>header</h1>
      </div>
     
      <div id="navi">
        test<br>
        test1<br>
        test2
      </div>
     
      <div id="content">
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        Inhalt blablablbalblbjklsdhbihsfiohsoifhsoifshfioushnjsbdgjkhdjkghdjhdxhgdikjcgioudhf<br>
        dfghdjghdfsjfhkjghskgjhsdfjkghsdfjk<br>
        jfdghdjfhfioghdiogdfgoj<br>
        dhfguidshgdiughsduifghsdifugh<br>
        </div>
        </body>
</html>

Vielen Dank
Gruß
Fabi
 
Hallo,

zeige mal ein Link oder nutze eine reset.css oder mach mal html auch margin und paddin 0

Cheffchen
 
html auch margin und padding 0: bringt nichts
reset.css: bringt auch nichts.


Vielen Dank für deine Bemühungen.
Bin für weitere Anregungen dankbar.

Gruß
Fabi
 
Zurück
Oben