Probleme mit margin-top
Raucherkrebs
- css
Hai,
ich möchte das zwischen dem A | B | C und dem Logo etwas mehr Abstand ist. Sollte margin-top:100px; im #header nicht bewirken, dass die Schrift 100px vom oberen Bildschirmrand weg ist?
Das hatte ich vor und so macht der IE es auch. Nur im Firefox klappt es nicht. Was mache ich falsch?
<style type="text/css">
body {font-family: Verdana, Arial, Helvetica, Geneva, sans-serif; }
#address { text-align: center; margin-top: 5px; font-size: 0.8em; }
#header { clear: right; text-align: center; margin-top: 100px; font-size: 1.5em; color: #cc0000; }
#logo { float: right; height:70px; }
#tippspiel { text-align: center; margin-top: 10px; }
#welcome { text-align: center; margin-top: 5px; }
</style>
</head>
<!-- beginn of body -->
<body>
<img id="logo" src="img/banner.jpg" width="370" height="70" alt="der banner" />
<div id="header">A | B | C</div>
<div id="tippspiel"><img src="img/tippspiel.gif" alt="Tippsiel" /></div>
<div id="welcome">
<h3>Herzlich Willkommen!</h3>
<a href="php/home.php?lang=de">Deutsch</a> |
<a href="php/home.php?lang=en">English</a> |
<a href="php/home.php?lang=es">Espanol</a> |
<a href="php/home.php?lang=it">Italiano</a> |
<a href="php/home.php?lang=nl">Nederlands</a> |
<a href="php/home.php?lang=el">Greek</a>
</div>
<div id="address">
Testweg 1<br />
12345 Testhausen<br />
Testland<br />
<img src="img/emails/webmaster.png" alt="" /></div>
</body>
</html>
Hi,
Sollte margin-top:100px; im #header nicht bewirken, dass die Schrift 100px vom oberen Bildschirmrand weg ist?
Nein, das bewirkt, das dein umgebendes Blockelemtn 100px von vorherigen Blockelement entfernt ist.
Ich gehe davon aus, das du padding suchst.
Ich gehe davon aus, das du padding suchst.
Richtig! Das klappt. Super! Ich habe das DIV um das tippsiel.jpg rausgenommen, da ich dachte, dass es überflüssig ist.
Nun ist die Grafik aber nicht mehr horizontal zentriert. Warum geht das nicht?
<img id="tippspiel" src="img/tippspiel.gif" alt="dentona Tippsiel" />
<img id="tippspiel" src="img/tippspiel.gif" alt="dentona Tippsiel" />
Wieso soll das nicht gehen? Ich weiss ja nicht genau, was du machen willst, dieser Ausdruck selbst ist aber völlig OK.
Moin Raucherkrebs,
Das hatte ich vor und so macht der IE es auch. Nur im Firefox klappt es nicht. Was mache ich falsch?
[...]klappt nicht[...] ist etwas dürftig für eine Fehlerbeschreibung.
<img id="logo" src="img/banner.jpg" width="370" height="70" alt="der banner" />
<div id="header">A | B | C</div>
Von wo aus wird nun der margin-top gemessen? Vom img aus, oder vom oberen Browserrand?
regds
Mike©
Hallo,
ich möchte das zwischen dem A | B | C und dem Logo etwas mehr Abstand ist.
#tippspiel { text-align: center; margin-top: 10px; }
Du hast derzeit 10px. Wenn mehr, dann nimm mehr.
:)
Sollte margin-top:100px; im #header nicht bewirken, dass die Schrift 100px vom oberen Bildschirmrand weg ist?
Ist sie ja auch.