HTML & CSS
I found a tutorial on how to create a text box, or leave a message box. The area for commenting however is just oneline horizontally. Is there a way to increase it's size vertically?
I believe the cols attribute increases it's height and the rows attribute increases its width.
Other way around. COLS is the width and ROWS is the height. They will of course be overridden by the width and height specified in the stylesheet.
So, im guessing it would be best to set the width and height of it in the stylesheet?
The rows and cols attributes are required for a textarea tag to be valid even though you override them in the CSS.
This worked...thanks as always.
<textarea rows="15" cols="60">
When you do this, check in all browsers. I might be doing something wrong every time, but whatever widths I set in HTML get screwy in each browser. What seems to be the right width in FF and Opera is wider (or thinner, I can't remember anymore) in IE, and Konqueror just can't get anything right-- often the width is so wide it goes off the screen, or at least outside the container. Damn that browser all to hell, acid test my butt.
Setting different widths in the CSS seems to make a difference, esp since I noticed someone (I can't remember who it was again) seemed to ignore the CSS so I actually did finally end up with most browsers looking alright (except Konq of course but fortunately nobody seems to use that one).
Someone might know why I see this, and it might also have to do with my using Gnome as my desktop setup, as it's definitely screwed with Firefox (form inputs especially, they are much too long when viewed in FF on any Linux distribution I can find who's running Gnome... KDE seems ok).
Well You cant get the same output in every browser perfectly Why code for konquerer lol. I don't know anyone who uses that.
The rows and cols attributes are basically there for people who have CSS turned off in their browser. The width and height in the CSS will override those values for everyone else giving a far more consistent output.
Why code for konquerer lol. I don't know anyone who uses that.
Since I don't expect each browser to be perfect, no, I don't worry. But I figure if I'm going to keep screen readers in mind while I code, I might as well keep Konq in mind too. I don't know anyone (except me) who uses it but as it comes with some Linux flavours I assume there are users.
How do you make those textarea's that automatically re-size when the viewer enters more content ?
Do you have an example? I think usually most people rely on the default height of a <textarea> element and the fact that overflow is set to scroll. If there's some type of auto resizer, then it must make use of at least two elements I think, querying the computed height of the element which contains text, and seeing if thats greater than or equal to the surrounding element. That or querying the length of the text, and doing some math based on the width of the element, length of string in relation to the width of outer element and such.. ahh my head's about to explode just thinking about it.
Exception, Shaun: Safari users get to change the height and width at will. There's a little corner you can pull at with the mouse.
I've heard people talk of such things but never actually seen it (changing as you type textareas). Is there some popular site with such things?
I've been hoping that is was something as simple as an overflow style (though nothing I've ever tried worked).
This topic is now closed. New replies are no longer allowed.