DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Text Input /w Background Image

08.22.2007
| 40887 views |
  • submit to reddit
        // self-explanatory. see title.

<style type="text/css">
.searchBox{
  background-image:url('http://www.dhtmlgoodies.com/tips-and-tricks/input-with-background/images/magnifying-glass.gif');
  background-repeat:no-repeat;
  padding-left:20px;
}
</style>

<input type="text" name="search" style="border:2px inset gray;color:black;background-color:lightyellow;font-family:arial narrow;font-weight:bold;font-size:9pt;" class="searchBox">