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

formular gestalten, submit button

beatles

Neues Mitglied
hallo zusammen

ich habe ein formular erstellt und es mit css formatiert resp. positioniert.
das komische ist, ich kann den submit button nicht positionieren, ich habe schon diverses versucht aber es gelingt mir einfach nicht....

hier die php datei mit dem formular

Code:
[COLOR=#A30096][FONT=Courier]<?php[/FONT][/COLOR][COLOR=#a30096]     if ($_SERVER['REQUEST_METHOD'] == 'POST') {[/COLOR]
[COLOR=#a30096]      session_start();[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]      $username = $_POST['username'];[/COLOR]
[COLOR=#a30096]      $passwort = $_POST['passwort'];[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]      $hostname = $_SERVER['HTTP_HOST'];[/COLOR]
[COLOR=#a30096]      $path = dirname($_SERVER['PHP_SELF']);[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]      // Benutzername und Passwort werden überprüft[/COLOR]
[COLOR=#a30096]      if ($username == 'xxx' && $passwort == 'xxx') {[/COLOR]
[COLOR=#a30096]       $_SESSION['angemeldet'] = true;[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]       // Weiterleitung zur geschützten Startseite[/COLOR]
[COLOR=#a30096]       if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') {[/COLOR]
[COLOR=#a30096]        if (php_sapi_name() == 'cgi') {[/COLOR]
[COLOR=#a30096]         header('Status: 303 See Other');[/COLOR]
[COLOR=#a30096]         }[/COLOR]
[COLOR=#a30096]        else {[/COLOR]
[COLOR=#a30096]         header('HTTP/1.1 303 See Other');[/COLOR]
[COLOR=#a30096]         }[/COLOR]
[COLOR=#a30096]        }[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]       header('Location: http://'.$hostname.($path == '/' ? '' : $path).'/gallery.php');[/COLOR]
[COLOR=#a30096]       exit;[/COLOR]
[COLOR=#a30096]       }[/COLOR]
[COLOR=#a30096]      }[/COLOR]
[COLOR=#a30096]?>[/COLOR]
[COLOR=#a30096]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/COLOR]
[COLOR=#a30096]<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">[/COLOR]
[COLOR=#a30096]<link rel="stylesheet" href="css/main.css" type="text/css" />[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]<head>[/COLOR]
[COLOR=#a30096]<title>xxxx</title>[/COLOR]
[COLOR=#a30096]</head>[/COLOR]
[COLOR=#a30096]<body>[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]<body>[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]<div style="position: absolute; top: 83px; left: 5px; z-index: 1;"><img src="xxx.jpg" width="275" height="408" align="left" />[/COLOR]
[COLOR=#a30096]</div>[/COLOR]
[COLOR=#a30096]<p>&nbsp;</p>[/COLOR]
[COLOR=#a30096]<p>&nbsp;</p>[/COLOR]
[COLOR=#a30096]<p>&nbsp;</p>[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]<form action="login.php" method="post">[/COLOR]
[COLOR=#a30096] [/COLOR]
[COLOR=#a30096]    <label>Name: </label> <input type="text" name="username" class="input" /><p>[/COLOR]
[COLOR=#a30096]    <label>Passwort: </label> <input type="password" name="passwort" class="input" /><p><input type="submit" class="submit" id="submit" value="Anmelden" />[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]<p>&nbsp;</p>[/COLOR]
[COLOR=#a30096]<p>&nbsp;</p>[/COLOR]
[COLOR=#a30096]<p>&nbsp;</p>[/COLOR]
[COLOR=#a30096]<p>&nbsp;</p><p><div style="position: absolute; top: 441px; left: 182px; z-index: 2;"><img src="images/border.jpg" alt="" width="755" height="47" /></div></p>[/COLOR]
[COLOR=#a30096]
[/COLOR]
[COLOR=#a30096]</form>[/COLOR]
[COLOR=#a30096]</body>[/COLOR]
[COLOR=#A30096][FONT=Courier]</html>[/FONT][/COLOR]




hier die css datei (beachte den punkt ".button" dieser sollte wichtig sein):

Code:
@charset "UTF-8";/* CSS Document */




/* Body */
    body {
	font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
        }


.input:hover {
    border: 1px solid #006;
    background: #C6C6C6;
}
.button {
    border: solid 1px;
       padding: 2px 6px;
	   margin-right: 2.5em;
	display: block;
	float:left;
}
.button:hover {
    border: solid 1px;
        padding: 2px 8px;
}
   label {
	margin-right: 1.5em;
	float: left;
	width: 25em;
	padding-top: 0.2em;
	text-align: right;
	     }
	     input {
		 display: block;
		 font-size: 1em;
		 margin-bottom: 0.8em;
		 border: 1px solid #000;
		 padding: 0.1em;
		 width: 8em;
		 }


br { clear: left; }
 
Ich suche in deinem HTML-Code vergeblich nach einer zugeteilten Klasse "Button", der Submit-Button hat vielmehr die ID und Klasse "submit".
 
oh ok vielen dank für den hinweis...
habe dies nun geändert:
Code:
[COLOR=#A30096][FONT=monospace]<input type="submit" [B]class="button"[/B] id="submit" value="Anmelden" />[/FONT][/COLOR]

leider ändert sich bei anpassung der css weder die position noch z.b. die rahmendicke (border)...
 
Mit dem Firebug Add-on für Firefox kannst du überprüfen, welche CSS-Regeln für welches Element greifen. Das ist bei sowas immer hilfreich.

- Firebug
 
Hilfreich kann auch sein, eine sehr einfache Seite zu machen, die nur die notwendigen Elemente (wie den Button) und das CCS enthält. Dann kann man erst mal sehen, ob überhaupt das gewünschte passiert.
 
Zurück
Oben