; The width CSS property. ; The cols attribute is used to tell the browser how many average-width characters should fit on a single line. Controlling the Width of a textarea. The cols attribute. There are two ways of controlling the width of a textarea:. In the html below, which is a simple textarea inside a fixed-width DIV, I want to make the textarea fit itself width-wise within the width of the div, with a nice little margin around the outside.