input.formInput { width: 255px; background: #a99787 url(formInput.gif) left top no-repeat; border: 0; padding: 3px; height: 22px; color: #302721; } input.formInput:hover, input.formInput:focus { background-position: -261px top; }
Try putting very long text below. Works fine in Firefox but in IE even IE 7, the background scrolls with the long input. When hovering over the input, the background changes. This uses :hover which is not supported by default in IE 6 but csshover behavior is used.
div.inputWrapper { width: 261px; background: #a99787 url(formInput.gif) left top no-repeat; color: #302721; } div.inputWrapper:hover, div.inputWrapper:focus { background-position: -261px top; } div.inputWrapper input { border: 0; padding: 3px; height: 22px; width: 255px; background-color: transparent; }