How to change font size in a textbox in html

前端 未结 3 1951
情歌与酒
情歌与酒 2020-12-05 03:32

How can I change the font size of text inside the textbox in html.

相关标签:
3条回答
  • 2020-12-05 04:22

    For a <input type='text'> element:

    input { font-size: 18px; }
    

    or for a <textarea>:

    textarea { font-size: 18px; }
    

    or for a <select>:

    select { font-size: 18px; }
    

    you get the drift.

    0 讨论(0)
  • 2020-12-05 04:26

    To actually do it in HTML with inline CSS (not with an external CSS style sheet)

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

    A lot of people would consider putting the style right into the html like this to be poor form. However, I frequently make extreeemly simple web pages for my own use that don't even have a <html> or <body> tag, and such is appropriate there.

    0 讨论(0)
  • 2020-12-05 04:32

    Here are some ways to edit the text and the size of the box:

    rows="insertNumber"
    cols="insertNumber"
    style="font-size:12pt"
    

    Example:

    <textarea rows="5" cols="30" style="font-size: 12pt" id="myText">Enter 
    Text Here</textarea>
    
    0 讨论(0)
提交回复
热议问题