How to set text size in a button in html

2019-06-15 01:08发布

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;"/> 

4条回答
你好瞎i
2楼-- · 2019-06-15 01:30

Try this, its working in FF

body,
input,
select,
button {
 font-family: Arial,Helvetica,sans-serif;
 font-size: 14px;
}
查看更多
成全新的幸福
3楼-- · 2019-06-15 01:42

Try this

<input type="submit" 
       value="HOME" 
       onclick="goHome()" 
       style="font-size : 20px; width: 100%; height: 100px;" /> 
查看更多
聊天终结者
4楼-- · 2019-06-15 01:50

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>

查看更多
Juvenile、少年°
5楼-- · 2019-06-15 01:54

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

input[type="submit"], input[type="button"] {
  font-size: 14px;
}
查看更多
登录 后发表回答