Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

fun with css part 2

0.00/5 (No votes)
13 Jun 2005 1  
spice up your <input /> fields

Sample Image - fun_with_css_part_2.gif

Introduction

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

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 :-)

License

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