Click here to Skip to main content
13,291,084 members (69,327 online)
Click here to Skip to main content
Add your own
alternative version


25 bookmarked
Posted 13 Jun 2005

fun with css part 2

, 13 Jun 2005
Rate this:
Please Sign up or sign in to vote.
spice up your <input /> fields

Sample Image - fun_with_css_part_2.gif


Have you ever considered a default <input /> field to be too boring? Why not enrich it with a background image? Nice idea for a login form or something similar. If you like the idea create the following .css style sheet.

.inputfieldsPassword {
    <FONT color=red>background</FONT>: <FONT color=blue>url('../pictures/password.png') no-repeat 0 1px;</FONT>
    <FONT color=red>background-color</FONT>: <FONT color=blue>white;</FONT>
    <FONT color=red>padding-left</FONT>: <FONT color=blue>17px;</FONT>
    <FONT color=red>font-size</FONT>: <FONT color=blue>8pt;</FONT>
    <FONT color=red>font-family</FONT>: <FONT color=blue>Verdana;</FONT>
    <FONT color=red>width</FONT>: <FONT color=blue>100%;</FONT>
    <FONT color=red>height</FONT>: <FONT color=blue>19px;</FONT>
    <FONT color=red>border</FONT>: <FONT color=blue>1px solid #7b9ebd;</FONT>

set the <input /> control's class property to the .css class created above

<input name="txtPasswort" type="password" id="txtPasswort" class="inputfieldsPassword" />

and again, enjoy :-)


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Daniel Walzenbach
Program Manager Microsoft
United States United States
Program Manager Visual Studio

You may also be interested in...

Comments and Discussions

GeneralSimple and Cool! Pin
Member 464791428-Apr-08 23:40
memberMember 464791428-Apr-08 23:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 13 Jun 2005
Article Copyright 2005 by Daniel Walzenbach
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid