HTML input button css-height not working on Safari and Chrome
Asked Answered
F

4

32

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?

Favela answered 16/9, 2012 at 21:12 Comment(3)
I'm not sure why this doesn't work alone, but I know if you add a background color it will read your height attribute: <input type="submit" value="Send" style="background: #eee; height: 50px;"/>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​Culp
It works in Safari 5 and Chrome 20 when no other CSS is involved. Please consider editing your question to include your CSS.Cinema
well it's working for me perhaps you have more css that you are not showing us?Mezzanine
E
60

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;
}
Edmundoedmunds answered 16/9, 2012 at 23:28 Comment(3)
Actually...I stand corrected. My problem was fixed by increasing the font size, changing it to a button did not solve it for me. Like the OP it worked fine in Firefox but didn't change in Safari, which was important for me as I wanted it to work on the iPhone.Riot
Just adding -webkit-appearance: none; on my <input> worked perfect for me.Arcuation
I came here while solving a problem that the <input> button was rendering as text. Adding -webkit-appearance: none; solved my problem too.Cuthbert
M
15

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

Mook answered 15/10, 2015 at 5:58 Comment(0)
F
6

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
Fungiform answered 23/2, 2015 at 2:13 Comment(2)
Are all those values relevant to this particular question? Can you perhaps narrow it down to a couple of the most relevant ones?Burmaburman
That are the possible vars for what I said -webkit-appearance:button; as example.Fang
G
0

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;
}
Guenzi answered 19/1, 2018 at 0:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.