Supportnet / Forum / Webseiten/HTML
Text-Ausrichtung in Klick-Button
Frage
Hallo,
dank der Hilfe hier habe ich nun meine Klickbutton.
Doch ich möchte die Beschriftung der Button horizontal zentriert haben, der Befehl "vertical-align:middle" funktioniert wohl nicht.
Was mache ich falsch ???? Kann es wohl daran liegen, dass sich die Button innerhalb einer Tabelle befinden???
Anbei der Quellcode
<style type="text/css">
<!--
a {color:inherit; background-color:inherit; }
a.button {display:block; width:200px; height:40px;
background-color:#3A2A7D; letter-spacing: 2px;
text-align:center; vertical-align:middle;
font-family:Verdana,Arial,Helvetica;
font-size:12px; color:#FFFFFF; font-weight:bold; }
a.button:link { border:thin outset gray;
text-decoration:none; }
a.button:active { border:thin inset blue;
text-decoration:none; }
a.button:visited { border:thin outset red;
text-decoration:none; }
a.button:hover { color:#FF0000; border:thin inset
white; text-decoration:none;
background-color:#3A2A7D;}
//-->
</style>
Vielen - vielen Dank
Antwort 1 von rfb
<style type="text/css">
<!--
a {color:inherit; background-color:inherit; }
a.button {display:block; width:200px; height:12px;
background-color:#3A2A7D; letter-spacing: 2px;
text-align:center; font-family:Verdana,Arial,Helvetica;
font-size:12px; color:#FFFFFF; font-weight:bold; }
a.button:link { border:thin outset gray;
text-decoration:none; padding-top:14px;padding-bottom:14px; }
a.button:active { border:thin inset blue;
text-decoration:none; }
a.button:visited { border:thin outset red;
text-decoration:none; }
a.button:hover { color:#FF0000; border:thin inset
white; text-decoration:none;
background-color:#3A2A7D;}
//-->
</style>
(Schrift-)Höhe 12 px + 2 * Innenabstand 14px = 40px die der Button vorher hatte

