Textarea should use Cols and rows to control width and height, instead of only using CSS

Source: Internet
Author: User
Tags html validator

In this case, the width and height of the element should be controlled by CSS. As a result, HTML validator prompts that textarea must have the Cols and rows attributes; otherwise, it does not comply with W3C XHTML 1.0 transitional standards.

 

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml" XML: lang = "Yue-Hans" lang = "Yue-Hans">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> it works ...... </title>
</Head>
<Body>
<Form action = "./" method = "get">
<Textarea name = "article"> </textarea>
</Form>
</Body>
</Html>

Error: Required attribute "rows" not specified

Error: Required attribute "Cols" not specified

 

A little strange, search for this website http://bytes.com/topic/html-css/answers/489646-textarea-cols-rows to explain well.

 

This involves the idea of HTML: for content-oriented webpages, HTML content should be easy to read when CSS is disabled.

If textarea does not have Cols and rows, when CSS is disabled, textarea becomes very small and users cannot enter many texts, which does not conform to the semantics of textarea-used to input large text segments.

Therefore, in XHTML 1.0 transitional, textarea must have the Cols and rows attributes and can be used together with CSS.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.