QNimate

  • CoursesVideos
  • WP PremiumPlugins
  • DemosLab
  • Home
  • QIdea
  • QTrack
Home Carbon Ads HTML Textarea Fixed Size

HTML Textarea Fixed Size

In this tutorial I will show you how to make HTML textarea element fixed size.

This simple CSS code disables resizing of the element.

textarea {
   resize: none;
}

Now you can use height and width property to provide a fixed height and width to the element. Some developers also use cols and rows css property to provide textarea size.

<textarea cols="num" rows="num"></textarea>
textarea {
    width: 100px;
    height: 100px;
}

You can also decide to resize your textareas only horizontal or vertical, this way:

textarea {
    resize: vertical;
}
textarea {
    resize: horizontal;
}
Oct 20, 2014Narayan Prusty
Stop requestAnimationFramerequestAnimationFrame Delay
Comments: 2
  1. war4u
    7 years ago

    size not fixed.
    u can fix it in stylesheet

    ReplyCancel
  2. adam
    7 years ago

    It is not ‘fixed size’ because modifying content changes the size, thus not fixed.

    ReplyCancel

Leave a Reply Cancel reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

Narayan Prusty

I am a software engineer specialising in Blockchain, DevOps and Go/JavaScript. This is my personal blog where I write about things that I learn and feel interesting to share.

8 years ago 2 Comments Web Development
Share this
0
GooglePlus
0
Facebook
0
Twitter
0
Linkedin
Related Articles
  • Horizontal and vertical Centering Using CSS
  • JavaScript Scroll by Dragging
  • HTML Table Designing and Best Practices with Examples
  • Response Tabs – Horizontal and Vertical
  • Detecting End Of Scrolling In HTML Element
Our Sponsor
My Books

2014 - 2015 © QNimate
All tutorials MIT license