Formularfeld zentrieren

Hallo HTMLer,

ich bin ziemlicher Anfänger in HTML und will gerne mein Formularfeld mittig in die Seite bekommen. Leider steht es ca. einen Zentimeter zu weit links. Vielen Dank schon mal

Nutzen tue ich style.css

Habe es mal hier her kopiert: Den Ausschnitt aus dem HTML Code steht unten.

@charset „utf-8“;
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
color: #333333;
background-image: url(…/images/repeater.jpg);
background-repeat: repeat-x;
margin-top: 0px;

}
#mainWrapper {
width: 734px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
}
#notice {
background-color: #fffbef;
padding-top: 5px;
padding-bottom: 5px;
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: #ede7c3;
border-bottom-color: #EDE7C3;
margin-top: 5px;
margin-bottom: 5px;
}

h2 {
font-weight: normal;
}

.style12 {
color: #620000;
font-size: 55px;
}

.style4 {
font-size: 36px;
color: #990000;
font-weight: bold;
}

form {
clear: both;
padding: 0px 0px;
}

input[type=text] {
    border: 2px solid #dddddd;
    width:235px;
    padding-left: 5px;
    padding-bottom:5px;
    padding-top:5px;
    margin-left:-5px;
    font-size: 14px;
    clear: both;
    margin-bottom:5px;
    display: block;
    font-weight: bold;
    background: #f9f9f9;
    
    width: 98%;
    color: #444;
}

#footer {
border-top-width: 1px;
border-top-style: solid;
border-top-color: #999999;
padding-top: 10px;
padding-bottom: 10px;
margin-top: 20px;
}
input[type=text]:focus {
border: 2px solid #65b3f9;
}

input[type=image] {
    display: block;
    margin: 0px auto;
    clear: both;
}

HTML-Code

.cr_site { background:#FFFFFF; text-align:center;} .cr_header { background-color:#ccc; } .cr_body {background-color:#efefef; padding:15px; } .cr_page {border-width:1px;border-color:#000000;border-style:solid; width:640px; } .cr_page {border-width:1px;border-color:#000000;border-style:solid;} .cr_font {font: normal 12px Arial, Helvetica, sans-serif;} .cr_header .logo {min-height:20px; } .cr_header_text p {display:block;margin:5;padding:5px;} .cr_ipe_item{ padding:1px 10px; margin:1px 10px; } .cr_ipe_item.inactive { display:none; } .cr_hr {border:0;background-color: #ccc;height: 1px;} .imprint {font-size:0.8em;} .cr_captcha {padding-center: 150px;} .cr_ipe_item .itemname{display:block;float:center;width:150px;text-align:center;margin:5px 0px 0px 0px;} .cr_ipe_item input[type="text"]{width:3ßßpx;} .cr_ipe_item textarea{width:300px;} .cr_ipe_item select{width:300px;} .cr_ipe_item p {margin:0;} .cr_ipe_item select {padding:5px 4px; border:1px solid #ccc; color:#333; background:#FFFFFF; margin:0px; padding:2px;} .cr_ipe_item textarea:focus, input[type="text"]:focus {border:1px solid #ababab;} .cr_ipe_item input, textarea{ padding:3px 3px; margin:2px; border:1px solid #ccc;} .cr_ipe_item input[type="checkbox"], input[type="radio"] { border:none; width:15px; } .cr_error {font-size:1.1em;padding:10px;} .clever_form_error { background-color: #f99; color:#fff; border:1px solid #f22 !important} .clever_form_note {margin:26px 0 0 3px;position:absolute;display:inline; padding: 2px 4px; font-weight:bold;background-color:#f2ecb5; color:#000; font-size:12px !important; } .cr_body {width:480px; } .cr_site {background-color:#ffffff;} .cr_header {background-color:#ffffff;color:#000;} .cr_body {background-color:#ffffff;font-size:12px;color:#000;} .cr_page {border-width:0px;border-style:none;border-color:#ffffff;width:275px;} .cr_site a {color:#0084ff;} .cr_hr {background-color:#ccc;}

tl;dr :mrgreen:

Es gibt zwei Möglichkeiten. Entweder formatiert man Formularfelder mittels einer Tabelle, oder, sauberer, über float im CSS.

Danke schon mal. Gibts da irgendwie eine Beispielseite oder Anleitung wie man das mit float im CSS zentriert?

Die Seite koennte ein guter Einstieg in die Positionierung von Elementen sein.

SELFHTML: Stylesheets / CSS-Eigenschaften / Positionierung und Anzeige von Elementen

Hallo.

Am besten löschen und noch mal von vorne anfangen.

Du hast eine CSS, zusätzlich benutzt du inline Styles und du schreibst CSS Styles in deinen HTML Code.

Abgesehen davon das dein CSS mit Schreibfehlern übersät ist (z. B. width:3ßßpx), vergibst du mehrmals die selben IDs die in deinem CSS überhaupt nicht zu sehen sind.

Es ist mir klar das du ein Anfänger bist aber in diesem Fall ist es besser das noch einmal zu machen als Stunden damit zuzubringen deinen Code aufzuräumen und zu korregieren.

Gruss
Elroy