html forms and liquid designs

S

Samuël van Laere

Is there a way to have liquid html forms?
By this i mean that a form should resize
when the user resizes the browser window
or changes resolution.

I set the textarea like this:
<textarea name="Message" cols="30" rows="10" ></textarea>

But this isn't any good for an liquid design,
horizontal scrollbars appear in the browser when resizing
a page that contains forms with cols and rows set.

Any toughts?
 
S

spaghetti

Samuël van Laere said:
I set the textarea like this:
<textarea name="Message" cols="30" rows="10" ></textarea>

But this isn't any good for an liquid design,
horizontal scrollbars appear in the browser when resizing
a page that contains forms with cols and rows set.

Just set a style in your stylesheet:

textarea { width:80%; }

On all the browsers I've tested this with, it seems to make the "cols"
attribute not matter, and the text in the text area expands and wraps at the
edge of the textarea box, not at the column specified. The cols and rows
attributes are required, which seems pretty weird to me. But whatever. Try
the above, it should work for what you need.
 
S

Samuël van Laere

spaghetti said:
Just set a style in your stylesheet:

textarea { width:80%; }

On all the browsers I've tested this with, it seems to make the "cols"
attribute not matter, and the text in the text area expands and wraps at the
edge of the textarea box, not at the column specified. The cols and rows
attributes are required, which seems pretty weird to me. But whatever. Try
the above, it should work for what you need.

Thanks a lot Spaghetti,

Seems to work fine, don't know if its proper use
but it is the only way and it does the job.
Perhaps its time that forms and there elements
start supporting procents as values, next to pixels.
 
S

spaghetti

Samuël van Laere said:
Seems to work fine, don't know if its proper use
but it is the only way and it does the job.
Perhaps its time that forms and there elements
start supporting procents as values, next to pixels.

Elements support all sorts of values: percentage, pixels, points, ems, etc.
etc.

The cols and rows attributes in <textarea> are for how many characters.

Setting the width with percentage in the stylesheet is the proper way. In
fact, I think cols and rows is silly, but I guess there is a pretty good
reason.

Unlike the <q> tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top