PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
Webdesign: HTML/CSS, Responsive Design, Sass...
CSS margin-top funktioniert nicht
Beitrag
<blockquote data-quote="maxsteel" data-source="post: 1466246" data-attributes="member: 250683"><p><strong>AW: CSS margin-top funktioniert nicht</strong></p><p></p><p>Hiho Leute,</p><p>danke für alles. Ich hätt noch eine kleine Frage <img src="/styles/default/xenforo/smilies/biggrin.gif" class="smilie" loading="lazy" alt=":D" title="Big Grin :D" data-shortname=":D" /></p><p>Bei folgendem Code:</p><p>[CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></p><p><html xmlns="http://www.w3.org/1999/xhtml"></p><p><head></p><p><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></p><p><title>Content Managment System (c)2010</title></p><p><link rel="stylesheet" type="text/css" href="css/style.css" /></p><p><link rel="shortcut icon" href="css/favicon.png"></p><p></head></p><p></p><p><body></p><p></p><p><div id="content_div"></p><p><div id="content_div_header"></p><p><h1>Kundenlogin</h1></p><p></div></p><p></p><p><h2>Vertragsnummer</h2></p><p><div class="textfelder"></p><p><input type="text" name="vertragsnummer"/></p><p></div></p><p></p><p><h2>Benutzername</h2></p><p><div class="textfelder"></p><p><input type="text" name="vertragsnummer"/></p><p></div></p><p></p><p><h2>Passwort</h2></p><p><div class="textfelder"></p><p><input type="password" name="vertragsnummer"/></p><p></div></p><p></p><p></div></p><p></body></p><p></html></p><p>[/CODE]</p><p></p><p>und hier das CSS:</p><p>[CODE]@charset "utf-8";</p><p>/* CSS Document */</p><p></p><p>html{</p><p> font-size:10px;</p><p>}</p><p>body {</p><p> color:#0000FF;</p><p> font: 100% Verdana, Arial, Helvetica, sans-serif;</p><p> margin: 0; </p><p> padding: 0;</p><p> </p><p>}</p><p></p><p></p><p>#content_div { </p><p> margin:0 auto;</p><p> width:500px;</p><p> height:190px;</p><p> background:#336699;</p><p> margin-top:23px; </p><p>} </p><p></p><p>#content_div_header { </p><p> margin:0 auto;</p><p> width:500px;</p><p> height:30px;</p><p> background:#330066;</p><p> margin-top:0px; </p><p>} </p><p></p><p>.textfelder {</p><p> display:inline-block;</p><p> margin-top:20px;</p><p> margin-left:70px;</p><p> color:#FFFFFF;</p><p> font-size:2em;</p><p>}</p><p></p><p></p><p></p><p>h2 {</p><p> display:inline-block;</p><p> margin-top:10px;</p><p> margin-left:20px;</p><p> color:#FFFFFF;</p><p> font-size:2em;</p><p>}</p><p>[/CODE]</p><p>Mein Problem ist, wie schaffe ich es das ich bei der Klasse textfelder nicht nur margin-left angeben kann sondern margin-rigth auch? wenn ich margin-right eingeb macht er bei mir garnichts.</p><p>Denn margin-left ist doof da es dann bei jdem anders ist. Danke schonmal auf eure Vorschläge.</p><p>mfg max</p></blockquote><p></p>
[QUOTE="maxsteel, post: 1466246, member: 250683"] [b]AW: CSS margin-top funktioniert nicht[/b] Hiho Leute, danke für alles. Ich hätt noch eine kleine Frage :D Bei folgendem Code: [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Content Managment System (c)2010</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="shortcut icon" href="css/favicon.png"> </head> <body> <div id="content_div"> <div id="content_div_header"> <h1>Kundenlogin</h1> </div> <h2>Vertragsnummer</h2> <div class="textfelder"> <input type="text" name="vertragsnummer"/> </div> <h2>Benutzername</h2> <div class="textfelder"> <input type="text" name="vertragsnummer"/> </div> <h2>Passwort</h2> <div class="textfelder"> <input type="password" name="vertragsnummer"/> </div> </div> </body> </html> [/CODE] und hier das CSS: [CODE]@charset "utf-8"; /* CSS Document */ html{ font-size:10px; } body { color:#0000FF; font: 100% Verdana, Arial, Helvetica, sans-serif; margin: 0; padding: 0; } #content_div { margin:0 auto; width:500px; height:190px; background:#336699; margin-top:23px; } #content_div_header { margin:0 auto; width:500px; height:30px; background:#330066; margin-top:0px; } .textfelder { display:inline-block; margin-top:20px; margin-left:70px; color:#FFFFFF; font-size:2em; } h2 { display:inline-block; margin-top:10px; margin-left:20px; color:#FFFFFF; font-size:2em; } [/CODE] Mein Problem ist, wie schaffe ich es das ich bei der Klasse textfelder nicht nur margin-left angeben kann sondern margin-rigth auch? wenn ich margin-right eingeb macht er bei mir garnichts. Denn margin-left ist doof da es dann bei jdem anders ist. Danke schonmal auf eure Vorschläge. mfg max [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ▲ = 5, ▼ = 2 und ■ = 7, was ist ▲ × ▼ + ■?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
Webdesign: HTML/CSS, Responsive Design, Sass...
CSS margin-top funktioniert nicht
Oben