How to set text size in a button in html

梦想的初衷 提交于 2019-12-22 01:43:34

问题


Hello I want to have a button on my website and I want to resize the text on my button. How do I do this?

My code is below:

<input type="submit" value="HOME" onclick="goHome()" style="width: 100%; height: 100px;"/> 

回答1:


Try this

<input type="submit" 
       value="HOME" 
       onclick="goHome()" 
       style="font-size : 20px; width: 100%; height: 100px;" /> 



回答2:


Try this, its working in FF

body,
input,
select,
button {
 font-family: Arial,Helvetica,sans-serif;
 font-size: 14px;
}



回答3:


Belated. If need any fancy button than anyone can try this.

#startStopBtn {
    font-size: 30px;
    font-weight: bold;
    display: inline-block;
    margin: 0 auto;
    color: #dcfbb4;
    background-color: green;
    border: 0.4em solid #d4f7da;
    border-radius: 50%;
    transition: all 0.3s;
    box-sizing: border-box;
    width: 4em;
    height: 4em;
    line-height: 3em;
    cursor: pointer;
    box-shadow: 0 0 0 rgba(0,0,0,0.1), inset 0 0 0 rgba(0,0,0,0.1);
    text-align: center;
}
#startStopBtn:hover{
    box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1);
    background-color: #29a074;
  }
<div id="startStopBtn" onclick="startStop()" class=""> Go!</div>



回答4:


Without using inline CSS you could set the text size of all your buttons using:

input[type="submit"], input[type="button"] {
  font-size: 14px;
}


来源:https://stackoverflow.com/questions/18310434/how-to-set-text-size-in-a-button-in-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!