CSS Input Box Makeover
He really loves people typing words into him but he doesn’t want to be sad anymore. CSS Input Box has been neglected for too long. His friends Bookmark, Banner and Background have been given the makeover treatment, while the trusty Input Box is doing most of the work. It’s time he deserves some tender loving care and he needs your help. This page shows you how.
Old Style Box
New Style White Box
HTML
<input type=text class=freshwhite>
CSS
input.freshwhite{
font-size:18px;
background: url(input-box-white387a.png) left center no-repeat;
height:43px;
width:451px;
border:0px;
padding-top:10px;
padding-bottom:3px;
padding-left:18px;
margin-right:15px;
outline: none;
}
input.freshwhite:hover{
background: url(input-box-white387b.png) transparent left center no-repeat;
}
input.freshwhite:focus{
background: url(input-box-white387a.png) transparent left center no-repeat;
}
IMAGES
copy these to the same folder as the CSS
New Style Blue Box
HTML
<input type=text class=freshblue>
CSS
IMAGES
copy these to the same folder as the CSS
Download this photoshop psd to make your own style and size
Download all files in this project
| Print article | Updated by Richard Eastes on August 6, 2010 2:57 am |

about 6 months ago
When you hover over the input boxes for the first time, there’s a moment where they appear “blank”. You can simulate it by doing a cache erase.
This happens because browsers don’t “preload” background css images. The “blank” moment there is the browser requesting the image.
If you don’t want this to happen, you have two options:
1. Force the preloading of the background images, probably with javascript. Or:
2. Use the same image for both states, and just change the origin on the “hover” style.
I think option 2 is more elegant and simple.