473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Defining width and height of text boxes with CSS

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
2 17935
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex Shi | last post by:
In php, is there a way obtain the width of a charactor of a certain font? Alex -- ================================================== Cell Phone Batteries at 30-50%+ off retail prices!...
10
by: Andy B | last post by:
Hi, I am very new to JavaScript and my first assignment is to create a simple game. Below is my code which works fine in IE, but not in any other browser (Opera, Netscape, Mozilla). It has no form...
11
by: Norman L. DeForest | last post by:
Am I misunderstanding the CSS specifications or is Firefox (version 1.0.6) (and Opera) doing the wrong thing? It appears that Firefox 1.0.6 includes the border in width calculations for tables...
3
by: stan | last post by:
I have code that produces 5 boxes across the screen width. So far I have only tested it in IE 6 and NS 8. It works in IE, but in NS I am not able to fit in the 5th box. I am using two...
6
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box....
5
by: Taras_96 | last post by:
Hi everyone, Can anyone tell me why the top paragraph block stretches across the screen (as you would expect), while the bottom div doesn't stretch across the entire screen? When I set the width...
1
by: lilOlMe | last post by:
I'm really starting to lose it on this problem. I have created 2 <div> tags that will server as boxes. While explaining my problem I will refer to these <div> tags as Boxes...to keep things...
2
by: Jukka K. Korpela | last post by:
Sub titulo "Re: DIV borders different in IE7 when in td" scripsit Ben C: This seems to be the heart of the matter, and I'm trying to get a real discussion started, by moving the discussion to...
1
by: RichardR | last post by:
I have a webpage which has a table that contains a column with several drop down boxes (<SELECT>). The contents of the drop down boxes are dynamically populated so I have no idea what the actually...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.