how do you increase the height of an html textbox

后端 未结 8 1063
野性不改
野性不改 2020-12-24 04:53

How do you increase the height of an textbox? (along with its font size)

相关标签:
8条回答
  • 2020-12-24 05:18

    If you want multiple lines consider this:

    <textarea rows="2"></textarea>
    

    Specify rows as needed.

    0 讨论(0)
  • 2020-12-24 05:20

    Use CSS:

    <html>
    <head>
    <style>
    .Large
    {
        font-size: 16pt;
        height: 50px;
    }
    </style>
    <body>
    <input type="text" class="Large">
    </body>
    </html>
    
    0 讨论(0)
  • 2020-12-24 05:31
    • With inline style:

      <input type="text" style="font-size: 18pt; height: 40px; width:280px; ">
      
    • or with apart CSS:

      HTML:

      <input type="text" id="txtbox">
      

      CSS:

      #txtbox {
          font-size: 18pt;
          height: 42px;
          width : 300px;
      }
      
    0 讨论(0)
  • 2020-12-24 05:33
    <input type="text" style="font-size:xxpt;height:xxpx">
    

    Just replace "xx" with whatever values you wish.

    0 讨论(0)
  • 2020-12-24 05:35

    Increasing the font size on a text box will usually expand its size automatically.

    <input type="text" style="font-size:16pt;">
    

    If you want to set a height that is not proportional to the font size, I would recommend using something like the following. This prevents browsers like IE from rendering the text inside at the top rather than vertically centered.

    .form-text{
        padding:15px 0;
    }
    
    0 讨论(0)
  • 2020-12-24 05:36

    Note that if you want a multi line text box you have to use a <textarea> instead of an <input type="text">.

    0 讨论(0)
提交回复
热议问题