Columns will not appear in the text box

This is terribly mysterious. I have a form with a textarea field. I removed the decorators and all that, and I'm setAttribswith strings and cols (in the Zend Framework). Textarea continues to be extremely wide, spilling out of its container and out of the viewport. If necessary, I can add a screenshot.

Here is the basic code:

<form id="edit-pending-email" enctype="application/x-www-form-urlencoded" method="post" action="[path]/email/edit-pending-email/">

<label for="salutation" class="optional">Salutation</label>

<input type="text" name="salutation" id="salutation" value="Yo" /> <p><label for="content" class="optional">Body of Email</label>

<textarea name="content" id="content" cols="40" rows="30"> blah blah ... text goes here ...

</textarea></p>

<input type="submit" name="save" id="save" value="Save" />

<input type="submit" name="cancel" id="cancel" value="Cancel" /></form>

Here are the oddities.

  • If you change the value of the lines, the lines change. If I change the cols value, nothing will change. But the lines are changing, so I know that the syntax is correct, and in any case, I switched with other developers. They do not know what is going on.
  • If I copy the code and paste it into a simple html page, the correct sizes are textarea

CSS ( , ), cols, - . , , cols , .

.

+3
2

width: auto cols ( , Chrome, ).

textarea {
  width: auto; 
}
+5

, , . . , , .

, , , ( ) , , cols. , .

, max-width. , . : . max-width.

Geez.

+1

Source: https://habr.com/ru/post/1789623/


All Articles