textarea - disable resize on x or y?

前端 未结 3 1113
庸人自扰
庸人自扰 2021-02-06 20:07

I know it\'s possible to disable the resize of a textarea by using:

textarea {
    resize: none;
}

But is it possible to disable e

相关标签:
3条回答
  • 2021-02-06 20:40
    resize: vertical;
    

    or

    resize: horizontal;
    

    Quick fiddle: http://jsfiddle.net/LLrh7Lte/

    0 讨论(0)
  • 2021-02-06 20:42

    You must use horizontal or vertical values for property.

    resize: vertical;
    

    or

    resize: horizontal;
    

    Source: https://www.w3schools.com/cssref/css3_pr_resize.asp

    0 讨论(0)
  • 2021-02-06 20:50

    Sure it is possible with css and jquery

    CSS:

    resize: vertical;
    resize: horizontal;
    

    jQuery

    $('textarea').css("resize", "vertical");
    $('textarea').css("resize", "horizontal");
    

    Bootstrap just put the class in Textarea

    for the vertical resize: vresize

    for the horizontal resize: hresize

    0 讨论(0)
提交回复
热议问题