how to adjust height in 2rows textarea.it look ok in ie.but collaps height in ff.
bellow is code

<td valign="top">
    <label>
    <textarea name="textarea" cols="21" rows="2"></textarea>
      </label>
  </td>

Dani AI

Generated

— the symptom you described (a two-line textarea that looks fine in IE but appears collapsed in Firefox) is a common cross‑browser quirk. The HTML rows attribute only requests a number of visible text lines; each browser maps that to pixels using its default font metrics, padding, borders and box model. was right to recommend controlling the size with CSS for predictable results. See the textarea docs for the exact behavior: textarea element.

A simple, reliable approach is to set the box model and a minimum height in relative units so the control scales with the font. For example:

textarea {
  box-sizing: border-box;
  min-height: 2.4em;   /* roughly two lines at the current font-size */
  line-height: 1.2;
  padding: 0.25em 0.35em;
  resize: vertical;    /* allow user resizing vertically only */
}

Notes and quick troubleshooting steps: inspect the textarea with Firefox DevTools and check the computed values for height, padding, border, box-sizing and line-height — any global CSS reset or a parent rule (for example line-height: 0 or an inline label with odd styles) can make it appear collapsed. Avoid wrapping form controls inside a label unless you need that behavior; use label for="id" plus an id on the textarea instead. If you need a fixed pixel size, use height in px, otherwise prefer em for accessibility.

More reference: MDN on CSS box-sizing and height is useful when fine-tuning cross‑browser layout: box-sizing, height.

I check your code and it is ok. Can I know what problem do you have? If you want to control the height of 'textarea', try with 'CSS', it will be more flexible and effective than HTML attribute.

when we used 2rows textarea i think it takes height bydefault bcoz in ie when we give specific height it show ok but in ff it dosent work

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.