By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,765 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,765 IT Pros & Developers. It's quick & easy.

Defining width and height of text boxes with CSS

P: n/a
Hi all.
I have a text box:
<input type="text" size="36"/>
and a textarea:
<textarea rows="3" cols="26"></texarea>
and I use these in several pages.

Is there a way to define the sizing of the text box and textarea in css,
so that if I will need to change them, I will be able to change it just
in the stylesheet, instead of changing every single occurence of these in html?

Thank you very much for help.

Anna
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Anna wrote:
Hi all.
I have a text box:
<input type="text" size="36"/>
and a textarea:
<textarea rows="3" cols="26"></texarea>
and I use these in several pages.

Is there a way to define the sizing of the text box and textarea in css,
so that if I will need to change them, I will be able to change it just
in the stylesheet, instead of changing every single occurence of these in html?
Yes. You'll have to apply display:block; to these elements if I remember
correctly.

Thank you very much for help.

Anna

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #2

P: n/a
Anna wrote:

I have a text box: <input type="text" size="36"/> and a textarea:
<textarea rows="3" cols="26"></texarea> and I use these in several
pages.

Is there a way to define the sizing of the text box and textarea in
css, so that if I will need to change them, I will be able to
change it just in the stylesheet, instead of changing every single
occurence of these in html?


In html 4.01 strict, you must define rows and columns attributes for
the textarea element, so you cannot *replace* them using css.
However, you can set sizes in css using width and height attributes.
Be careful not to force horizontal scrolling when doing so.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.