I am trying to add some padding inside the <textarea> however no matter which I use (margin | padding) the scrollbars are pushed off screen by equal amounts.
What is the CSS trick to accomplish this, so that the text is not flush against the sides of the control?
I cannot embed the textarea inside a DIV so this all needs to be done within the styles of the textarea control itself.
p.s-The width is set to 100% so I'm not sure if that changes things.
Cheers,
Alex
<textarea> padding or margins?
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: <textarea> padding or margins?
Actual width of the textarea is width (100% of available width in your case) + border + padding + margin.
Possible solution is to set width to px or smaller %.
Possible solution is to set width to px or smaller %.
Re: <textarea> padding or margins?
Does the width of the textarea change? You said it's set to 100%, but does it's container or one of it's parent have dynamic width? If not, set the width to a few less pixels, and add some padding. If the width of the textarea is dynamic, I think you're screwed.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.