Textarea uses cols and rows instead of css to control the height and width

Source: Internet
Author: User
Tags html validator

In the tutorial of www.bkjia.com, we thought that the width and height of all elements 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.

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.