On 14/07/2004, at 5:13 AM, Ted Drake wrote:

In the 5th edition of O'Reilly's HTML and XHTML the definitive guide, they suggest listing a size and max length for the text input field. I would like to define the width with css and leave out the size attribute on my input fields. I'm trying to remove as much styling from our forms as possible and this works in my testing so far.

I'm wondering if anyone has any more concrete opinions on the practice of defining width of input and select fields with css instead of the size attribute.

In my opinion, you still need to set a "default" width for the element using the size attribute, for those without CSS. Yes, it will be overridden with CSS for 99% of your browsing audience, but it safer to put *something* in there as default, since you have no idea how a browser will behave without it.


Most browsers seem to put in a sensible default width if you exclude the size attribute, but I think "better the devil you know" in this case -- since you can't possibly test on every useragent available, let's give them a sensible default, then style over the top of it.


--- Justin French http://indent.com.au

*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************




Reply via email to