HTML input button css-height not working on Safari

2019-01-22 02:44发布

I have a very basic question. I am setting height to 50px for my html form submit button. It works on Firefox but not Chrome nor Safari. The code is as simple as following:

<input type="submit" value="Send" style="height:50px;" />

Any idea how to make it work on Chrome and Safari?

4条回答
老娘就宠你
2楼-- · 2019-01-22 03:18

This should be working also.

  -webkit-appearance:default-button;

There are quite a few parameters for this property that you may want to take advantage of and/or watch out for. Also, If you simply wanted to disable inner-shadows of input fields you could just use -webkit-appearance:caret;.

button
button-bevel
caret
checkbox
default-button
listbox
listitem
media-fullscreen-button
media-mute-button
media-play-button
media-seek-back-button
media-seek-forward-button
media-slider
media-sliderthumb
menulist
menulist-button
menulist-text
menulist-textfield
none
push-button
radio
searchfield
searchfield-cancel-button
searchfield-decoration
searchfield-results-button
searchfield-results-decoration
slider-horizontal
slider-vertical
sliderthumb-horizontal
sliderthumb-vertical
square-button
textarea
textfield
查看更多
欢心
3楼-- · 2019-01-22 03:27

Just adding -webkit-appearance: none; on my <input> worked for me on safari browser on Macbook.

查看更多
看我几分像从前
4楼-- · 2019-01-22 03:29

Adding to Şήøωў's (upvoted)answer:

@ Safari 11.0.2 (13604.4.7.1.3) @ macOS 10.13.2 (17C88)
e.g.

input[type=button]{
  -webkit-appearance: button;
}

solved my issue (of only -size of mostly [-webkit-]font-* having very limited effect);
overriding "User Agent Stylesheet":

input:matches([type="button"], [type="submit"], [type="reset"]){
  -webkit-appearance: push-button;
}
查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-22 03:37

Change it from <input> to <button> and add -webkit-appearance: none; to the start of your CSS, eg:

.submitbtn {
    -webkit-appearance: none;
    height: 50px;
    background-color:#FFF;
    color:#666;
    font-weight:bold;
    border: solid #666 1px;
    font-size: 14px;
}
查看更多
登录 后发表回答