Generale

Input Text / Text Area Size

the form:

<form id="defineForm" method="POST" action="api/test">
  <fieldset>
    <legend>Generale</legend>
        <input type="text" name="id" size="60" maxlength="60"/>
        <input type="text" name="descr" size="60"/>
        <textarea name="longDescr" cols="62" rows="10"></textarea>

using cols="62"for "longDescr" and size="60"for "id" gives an area of the same width (oh, oh !!!)! on IE8:

   [text] 
   [text]
   [textarea]
   []

Of course, these values ​​lead to a different result in Firefox (two different widths, as I expect), something like:

   [text] 
   [text]
   [textarea]
   []

How can I force the same width, at least on IE7 / 8 and Firefox, to input text and text fields?

EDIT

I use this CSS:

input, textarea {
    margin: 15px;
    padding: 3px;
    display: block;
    width: 20ex;
}

but it does not work on firefox

+3
source share
2 answers

CSS width, :

#id, #longDescr {
    width: 60ex;
}

id, name, .

, , , . :

#id, #longDescr {
    font: inherit;
    width: 60ex;
}

, , , , .

+5

, CSS display inline-block width .

<label> . , , , .

+1

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


All Articles