CSS3: Prohibit user from changing textarea size

Source: Internet
Author: User

First, preface

The default for FF, Chrome, and Safari allows the user to change the size of the textarea in a drag-and-drop manner, which is not only different from the behavior characteristics of the textarea under IE, but also textarea the size of its parent node, which destroys the overall layout.

Second, the reason

by calling window.getComputedStyle (textarea element, null). Resize Return both, we can know that the original resize style properties of the ghost.

Third, CSS3 attribute ──resize

The mechanism used to set the size of the useragent adjustment element is to set the user's ability and how to change the element size themselves.

Value Range

None: useragent adjustment element size is not allowed;

both : Allows useragent to adjust the horizontal and vertical dimensions of the element;

Vertical: Allows the useragent to adjust the dimension of the element's vertical direction;

Horizontal: Allows useragent to adjust the dimension of the horizontal direction of the element;

inherit : Inherit parent element

Under FF, Chrome, and Safari

For a Div, the Resize property value is inherit (in fact, none), whereas for textarea the default value is both.

Iv. Solutions

Set Resize:none for textarea

Respect the original, reprint please indicate from: http://www.cnblogs.com/fsjohnhuang/p/3940728.html ^_^ Fat Boy John

CSS3: Prohibit user from changing textarea size

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.