473,654 Members | 3,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

form examples in css2?

Hi,

I'm having problems with css2/xhtml based form. I didn't find examples
to see what can be done, especially textarea. How to define cols="45"
rows="4" in css?
Jul 21 '05 #1
8 4106
Franck wrote:
Hi,

I'm having problems with css2/xhtml based form. I didn't find examples
to see what can be done, especially textarea. How to define cols="45"
rows="4" in css?


You can't define.
Number of columns and rows is part of functionality definition of form
elements, not a layout definition.

--
Janusz 'Kali' Kaliszczak
=> http://janusz.kaliszczak.pl/
Jul 21 '05 #2
On Thu, 27 Jan 2005 11:40:12 +0100, Franck <fl************ ****@free.fr>
wrote:
Hi,

I'm having problems with css2/xhtml based form. I didn't find examples
to see what can be done, especially textarea. How to define cols="45"
rows="4" in css?


Salut Franck! Voilà:
http://www.quirksmode.org/css/forms.html

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Discover Opera: http://members.surfeu.fi/jerkku/
http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #3
Franck <fl************ ****@free.fr> wrote:
I'm having problems with css2/xhtml based form. I didn't find examples
to see what can be done, especially textarea. How to define cols="45"
rows="4" in css?


You can set the width and height for the textarea just the same as for
any other element. But you must still include the cols and rows in the
HTML as those attributes are required by the HTML specification.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 21 '05 #4
Steve Pugh wrote:

You can set the width and height for the textarea just the same as for
any other element. But you must still include the cols and rows in the
HTML as those attributes are required by the HTML specification.


This is a genuine query.

Why "must" one include the cols and rows attributes if height and width
are declared by a css rule set. Is it just to satisfy the validator?

"The required ROWS and COLS attributes specify the number of visible
rows and columns, respectively, in a visual browser. These attributes
provide a <<guide>> for the user rather than a restriction; browsers
allow an unlimited amount of text input in theory, though in practice
many browsers limit the contents of a TEXTAREA to 32 or 64 kilobytes".

The css properties WIDTH and ROW seem to provide the same <<guide>> and
moreover seem to over ride the HTML attributes. Do I miss something?

Louise
Jul 21 '05 #5
You can set the width and height for the textarea just the same as for
any other element. But you must still include the cols and rows in the
HTML as those attributes are required by the HTML specification.


thanks guys, I got it!
Jul 21 '05 #6
boclair <bo*****@boclai r.com> wrote:
Steve Pugh wrote:
You can set the width and height for the textarea just the same as for
any other element. But you must still include the cols and rows in the
HTML as those attributes are required by the HTML specification.
This is a genuine query.

Why "must" one include the cols and rows attributes if height and width
are declared by a css rule set. Is it just to satisfy the validator?


It's not just the satisfy the validator - the validator requires it
because the spec requires it. Not the other way round.

But why does the spec require it is a good question. I'm not sure I
have a complete answer.
"The required ROWS and COLS attributes specify the number of visible
rows and columns, respectively, in a visual browser. These attributes
provide a <<guide>> for the user rather than a restriction; browsers
allow an unlimited amount of text input in theory, though in practice
many browsers limit the contents of a TEXTAREA to 32 or 64 kilobytes".
It's interesting that the mention of them being a 'guide' is in the
same sentence as the mention of a limit on the size of the data
accepted. A smart author can pick col and row values that give users a
guide as to how much data is expected from them. As such it would not
be unreasonable for non-visual user agents to indicate this 'size' in
some way.
The css properties WIDTH and ROW seem to provide the same <<guide>> and
moreover seem to over ride the HTML attributes. Do I miss something?


The row and col values are (loosely) tied to the size of a character
and thus fit well with the "expected amount of data" idea. The CSS
length units can be (loosely) tied to the size of a character (em and
ex) or totally divorced from it (px, mm, %, etc.) so the two are not
interchangable.

In practical rather than theoretical terms you should start by
recalling that CSS is optional. Some browsers have very silly default
sizes for textareas and specifying a sensible fallback for when CSS is
not enabled (or is being ignored, e.g. Opera has an option to disable
styling of just form elements) is smart.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 21 '05 #7
Steve Pugh <st***@pugh.net > wrote:
But why does the spec require it is a good question. I'm not sure I
have a complete answer.
Neither do I, especially since the HTML spec does not require a SIZE
attribute in <input> elements but implies some browser-specific default
(though the situation is different, since not all <input> elements are text
input fields). My answer is that there is no good answer. Someone just
decided that ROWS and COLS are required, instead of deciding that browsers
are expected to use some defaults. (They were required even in HTML 2.0.)
"The required ROWS and COLS attributes specify the number of visible
rows and columns, respectively, in a visual browser. These attributes
provide a <<guide>> for the user rather than a restriction; browsers
allow an unlimited amount of text input in theory, though in practice
many browsers limit the contents of a TEXTAREA to 32 or 64 kilobytes".


It's interesting that the mention of them being a 'guide' is in the
same sentence as the mention of a limit on the size of the data
accepted.


The text was quoted without specifying the source. It is apparently from
the WDG HTML 4.0 reference, which is excellent, but not a specification:
http://www.htmlhelp.com/reference/ht.../textarea.html
The specification
http://www.w3.org/TR/html4/interact/...#edef-TEXTAREA
defines ROWS as specifying the number of rows and COLS as specifying "the
visible width in average character widths". So they are specific
instructions to browsers rather than a guide. Quite independently of this,
browsers are expected to allow unlimited input, i.e. the numbers are not
limits upon amount of data but dimensions of physical input area.
A smart author can pick col and row values that give users a
guide as to how much data is expected from them. As such it would not
be unreasonable for non-visual user agents to indicate this 'size' in
some way.
Or maybe it would. In practice at least. It is horrendously common to
specify ridiculously small ROWS and COLS attributes. I guess the resulting
stamp size honestly reflects the value assigned to user input by the form
designer. But I still would not suggest that non-visual user agents tell
some guesses based on those values. After all, if the user input has some
maximum or recommended size, then it's the form designer's job to tell them
in the textual content before the field.
The css properties WIDTH and ROW seem to provide the same <<guide>> and
moreover seem to over ride the HTML attributes. Do I miss something?


The row and col values are (loosely) tied to the size of a character
and thus fit well with the "expected amount of data" idea.


Technically, they are related to text line height and average character
width.
The CSS
length units can be (loosely) tied to the size of a character (em and
ex) or totally divorced from it (px, mm, %, etc.) so the two are not
interchangable.
In practice, ROWS and COLS are often the _best_ way to specify the
dimension. They have no direct CSS counterpart. But if you explicitly set
line-height, then ROWS="n" should be equivalent to height: n2, where n2 is
n multiplied by the line-height value. But this is not very relevant, since
the ROWS attribute is required. For COLS, there is really no CSS
equivalent; there is no concept like "average character width" in CSS.
As a rough rule of thumb, em corresponds to two times the average character
width and ex corresponds to the average character width. But this is just
the average over fonts. In most fonts, it's either bigger or smaller.
In practical rather than theoretical terms you should start by
recalling that CSS is optional. Some browsers have very silly default
sizes for textareas - -


Or they may have no defaults. A textarea without those attributes is a
syntax error, and browsers may do whatever they like, e.g. not render the
textarea at all.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 21 '05 #8
"Jukka K. Korpela" <jk******@cs.tu t.fi> wrote:
Steve Pugh <st***@pugh.net > wrote:
But why does the spec require it is a good question. I'm not sure I
have a complete answer.
Neither do I,


Oh good, that probably means I didn't miss anything obvious.
My answer is that there is no good answer. Someone just
decided that ROWS and COLS are required, instead of deciding that browsers
are expected to use some defaults. (They were required even in HTML 2.0.)
And, unlike in some other cases, HTML 2.0 doesn't provide a clearer
rationale over that (not) given in HTML 4.01 :-(
"The required ROWS and COLS attributes specify the number of visible
rows and columns, respectively, in a visual browser. These attributes
provide a <<guide>> for the user rather than a restriction; browsers
allow an unlimited amount of text input in theory, though in practice
many browsers limit the contents of a TEXTAREA to 32 or 64 kilobytes".


It's interesting that the mention of them being a 'guide' is in the
same sentence as the mention of a limit on the size of the data
accepted.


The text was quoted without specifying the source. It is apparently from
the WDG HTML 4.0 reference, which is excellent, but not a specification:
http://www.htmlhelp.com/reference/ht.../textarea.html


Oh, well, in that case my little thought experiment is a bit of a
waste of time. Never mind.
browsers are expected to allow unlimited input, i.e. the numbers are not
limits upon amount of data but dimensions of physical input area.


Oh yes. I never meant to imply otherwise.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3511
by: Bob Smith | last post by:
Hi all I have a page which contains a form. I want a customized button with an image for the submit button, and when the submit button has been clicked send the form to the perl script. Now the form is no problem but the button is, so the question is how do I create a custom button and how do I submit the form with javascript when the button is clicked? many thank's for any hint and help B
4
9539
by: Neil Zanella | last post by:
Hello, I would like to know what the major enhancements of CSS2 over CSS1 are and whether CSS2 support is any better these days than it was a few years ago. In particular, do most browsers fully support CSS1 nowadays? What about CSS2? I like the idea of CSS, and prefer XHTML syntax to HTML 4.01 because I can use the class attribute to define style, instead of having a bunch of markup junk everywhere. Now I want to get the most of out of...
12
1911
by: Michael Winter | last post by:
Is it possible to test for CSS level 2 support, preferably using just CSS2? For example, the following could alert the user that their browser doesn't support CSS1 or 2. Is there an equivalent for level 2 only? Many thanks, Mike
6
7483
by: Patrick | last post by:
Hi I am a newbie struggling a little with css.It is hard to get it right in all browsers, so i decided to read the CSS2 specification on the w3 site. What is the following from the CSS2 specification: "Quote starts": 5.6 Child selectors
20
2797
by: Karl Smith | last post by:
I heard a rumour that Opera succeeded where none have before, and implemented the tables described in HTML4 and CSS2. So I thought I'd try it out with the well known Periodic Table. http://users.tpg.com.au/karl6740/css/table_elements_periodic.html CSS: Notice in the TRs with the lanthanides and actinides, the empty TDs at the end taking the background colour of the TR? I say they shouldn't
14
2598
by: Michael Bulatovich | last post by:
Has anyone got a good link to a concise discussion of where things now stand regarding these two? e.g. What browsers are compliant with one or the other? What the adoption rate is of these browsers? How are site developers dealing with what appears to me to be the
2
1776
by: Jan Roland Eriksson | last post by:
The following URL... <http://www.w3.org/TR/CSS21/> ....has had the following text in it for a considerable time now. "This is a W3C Candidate Recommendation, which means the specification has been widely reviewed and W3C recommends that it be implemented. It will remain Candidate Recommendation at least until 1 September 2004."
2
2088
by: Xah Lee | last post by:
what's new in CSS2? http://xahlee.org/js/css2.html Xah xah@xahlee.org ∑ http://xahlee.org/
2
1603
by: David E. Ross | last post by:
A new working draft of the CSS2.1 specification was published on-line on 11 April. Does anyone know what changed since the previous (13 June 2005) working draft? -- David E. Ross <http://www.rossde.com/> Concerned about someone (e.g., Pres. Bush) snooping
0
8379
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8494
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.