Nuisance
Nuisance

Reputation: 455

How to change textarea size on html?

I need to set my textarea size to 64%, but I can't. Can you help me to do this. Thanks for your help :)

<!DOCTYPE html>
<html>
<body>
<style>
div.c18 {position: absolute;width:64%;left:18%}
div.c7 {position:relative;overflow:hidden;left:18%;}
</style>


<div class="c7">OTHER</div>
<div class="c18">
<input type="textarea">
</div>
</br>

</body>
</html>

Upvotes: 1

Views: 760

Answers (4)

Rahul Patel
Rahul Patel

Reputation: 5246

First of all the textarea shall be used by textarea html tag And to give height and width to textarea "rows" and "cols" property will be used. Please refer below code.

<textarea rows="10" cols="80"></textarea>

Upvotes: 1

Chaitanya
Chaitanya

Reputation: 729

Instead of giving width to the container, give a specific width to the textarea. Like:

CSS

#area { width: 50%; }

HTML

<textarea id="area">
</textarea>

Upvotes: 0

charlietfl
charlietfl

Reputation: 171679

Set the width of the child <input> or <textarea> to 100% so it fills the parent that is 64%

<input type="text" style="width:100%">

This can obviously be changed to a stylesheet rule

DEMO

Upvotes: 0

RasmusGlenvig
RasmusGlenvig

Reputation: 765

You need to add how many rows and columns you want.

You can do like this:

<textarea rows="10" cols="80">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non augue nec risus lobortis pulvinar. Mauris imperdiet orci vitae commodo condimentum. Nam molestie risus iaculis enim dictum egestas. Vivamus commodo mauris consectetur diam fringilla, ut tempor nulla volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla feugiat fringilla turpis in feugiat. In hac habitasse platea dictumst. Aenean laoreet orci et varius fermentum.
</textarea>

Upvotes: 0

Related Questions