Click to See Complete Forum and Search --> : Textarea scrollbar and background problem in IE


callMeAl
08-16-2009, 07:17 PM
I'm new here so hi guys, nice to meet you:).

I have a 'textarea' form field for which I've set a background image. I've set CSS 'overflow' property to 'auto' to eliminate scrollbar in IE(because it appears even without the content).

The problem is that when the text inside my 'textarea' is taller than its height the scrollbar appears and starts scrolling the text with the background. It happens only in IE. In FF everything works fine - the background stays in place as the text is scrolled.

My question is: what to do in order to force IE to leave the 'textarea' background and scroll only the text.

Thank you in advance for suggestions.

multimediocrity
08-16-2009, 11:53 PM
I think I know what you're asking. You want the background image to stay in one place when it scrolls?

Try this property on your background in the textarea:

background-attachment: fixed;

callMeAl
08-17-2009, 12:42 PM
I think I know what you're asking. You want the background image to stay in one place when it scrolls?

Try this property on your background in the textarea:

background-attachment: fixed;


Thanks for a suggestion multimediocrity. I tried to do this but then textarea's background disappears.

However I found out that I can apply my background to the div container which holds textarea field. Everything works fine in both browsers(IE&FF) besides top and bottom padding in IE. I have to set it separately for this browser. Could you suggest me which way would be better to do this: CSS conditional comments or JavaScript?

Below is the link to the form which we are talking about:

http://www.satrans.net/test.html


Thanks.

multimediocrity
08-17-2009, 02:13 PM
Hmm... that's strange.

As far as which is better, CSS or JavaScript, I think it's a matter of personal preference.

Your form looks nice, though!