Beiträge von Binkoeln
-
-
Hallo, ich hab ne doofe Frage:
Wenn ich
<ul>
<li>Beispiel</li>
</ul>
mache kann ich in css
ul li {
}
benutzen.
Wenn ich aber
<p>
<h1>Beispiel</h1>
Text
</p>
mache funktioniert
p h1 {
}
nicht sondern nur
p~h1{
}
Ich verstehe den Unterschied nicht.
Sind doch beide innerhalb des jeweiligen Tag, in dem Sinne also beides "Siblings"
....
-
Stimmt! Der entscheidenden Punkt war:
.header-login form auf display: inline;
zu setzten!
Vielen Dank!!!
-
Der Grund ist, dass ein Formular ein Blockelement ist und dass Du das a-Element ebenfalls zu einem Block-Element gemacht hast.
Hallo Sempervivum,
den Verdacht hatte ich auch und habe daher alles auf: display:inline-block; (und testweise auch auf display:inline;) gesetzt (siehe angehängter code)
Hat aber leider nichts gebracht....
Code
Alles anzeigen} nav ul li a { display: inline-block; font-family: arial; color:#222; font-size: 14px; padding: 22px 14px; text-decoration: none; } .header-login{ float:right; } .sign{ float: right; text-decoration: none; display: inline-block; font-family: arial; color:#222; font-size: 14px; padding-right: 10px; padding-top: 5px; } button{ background-color: #777; color:white; height:30px; width: 50px; border-radius: 2px; border:none; cursor: pointer; display: inline-block; }
-
Hallo m.scateello,
erstmal Danke für deine Antwort!
Mit dem ersten Formular soll man sich einloggen können.
Der Link soll zu einer eigenen(sichtbaren)PHP-Seite führen bei der man sich ein Konto erstellen kann (Signup)
Das zweite Formular (logout) brauche ich als Formular weil ich den Namen vom Button brauche um eine Session-Variable zu übergeben.
(Den Logout/Login Button will ich später noch auf display:none; stellen, je nach dem ob man eingeloggt ist oder nicht)
-
Hallo ich versuche ein Menü für eine Loginseite zu erstellen.
Aus irgendeinem Grund rutschen "Logout" und "Konto erstellen" in die nächste Zeile....
Ich hätte sie gerne alle in einer Zeile...
Danke schonmal!!
Code
Alles anzeigenHTML CODE: <nav> <a href="#"><img class="header-logo" src="img/logo.png" alt="Logo"></a> <ul> <li><a href="index.php">Home</a></li> <li><a href="#">Über uns</a></li> <li><a href="#">Contact</a></li> <li><a href="#">Impressum</a></li> </ul> <!--Hier ist die LoginForm--> <div class="header-login"> <form action="includes/login.inc.php" method="post"> <input type="text" name="mailuid" placeholder="Benutzername/E-mail..."> <input type="password" name="pwd" placeholder="Passwort..."> <button type="submit" name="login-submit">Login</button> </form> <!--Hier geht es zur Anmeldeseite--> <a class="sign" href="signup.php">Konto erstellen</a> <!--Hier geht es zum Logoutscript--> <form action="includes/logout.inc.php" method="post"> <button type="submit" name="logout-submit">Logout</button> </form> </div> </nav> CSS-Datei: nav{ width: 100%; height: 60px; background-color: #fff; } .header-logo{ float:left; height: 60px; } nav ul{ float:left; } nav ul li{ float: left; list-style:none; } nav ul li a { display: block; font-family: arial; color:#222; font-size: 14px; padding: 22px 14px; text-decoration: none; } .header-login{ float:right; } .sign{ float: right; text-decoration: none; display: block; font-family: arial; color:#222; font-size: 14px; padding-right: 10px; padding-top: 5px; } button{ background-color: #777; color:white; height:30px; width: 50px; border-radius: 2px; border:none; cursor: pointer; }
Ich weiß float ist eher alt und man sollte z.B. Flexbox benutzen, aber mich interessiert warum es nicht funktioniert...