XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   CSS (http://xhtmlforum.de/forumdisplay.php?f=73)
-   -   Icon im Input (http://xhtmlforum.de/showthread.php?t=57037)

Bara 15.05.2009 06:19

Icon im Input
 
Hallo allerseits

Ich möchte via CSS etwas mein Kontaktformular aufbessern.
Dazu möchte ich die Eingabefelder mit einem Icon versehen.

Ich habe dies mal grafisch im Paint zusammengestellt, wie ich mir das vorstelle:
http://img3.imagebanana.com/img/tcbri3e1/iconfeld.png

So sollte das aussehen, nun fehlt mir jeder Ansatz dies in meiner CSS-Datei zu realiseren.

Vielen Dank für Hilfe
Jörg

Scheppertreiber 15.05.2009 06:32

Mach ein Kästchen (<div>) mit einem Rand, gib dem das Hintergrundbild "Stift", dann lege das
<input> rechts daneben.

Bara 15.05.2009 07:02

Danke für die Antwort

Das ganze wäre etwas umständlich, da ich diese Umsetzung auf einem Portal durchführe welches eine Vielzahl von Formularen hat (Registrierung, Passwort ändern, Profil etc.)

Ich habe es allerdings doch via CSS hinbekommen, habe einfach ein wenig rum experementiert.

Das Ergebnis in der CSS:
Code:

.stift {
        padding:                        4px 0px 0 23px;
        font-size:                        11px;
        border-bottom:                1px #38afc8 dotted;
        background:                white url('../icon/stift.png') no-repeat 3px 3px;
        height:                        16px;
        width:                        200px;
}

und das Formularfeld dann

HTML-Code:

<input class="stift" type="text">

Scheppertreiber 15.05.2009 07:05

Du hast recht. Deine Lösung ist kleiner, also besser. 8)


Alle Zeitangaben in WEZ +2. Es ist jetzt 16:03 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023