how to make placeholder font (in form) sizes the same across devices?

时光毁灭记忆、已成空白 提交于 2020-02-16 06:58:08

问题


Using the below CSS, I have managed to get the placeholder font size to be similar for all common android browsers, but iphone's browser makes the placeholder font so tiny it's barely readable. If I increase the size so that it is readable, it becomes so huge on all other android browsers that it won't even fit in the form boxes (and looks ridiculous as it is larger than even the header font).

Is there a workaround to change the font size for just safari browsers? This massive disparity in font size is absurd, and I can't even find a compromise between the two where both are readable. cbtemail.com is the site if you want to see it.

input {
    margin-bottom: 20px;
    background-color: #CCC;
    color: #000;
    height: 60px;
    font-size:28px
}
textarea {
    background-color: #ccc;
    width:100%;
    margin-bottom: 20px;
    height: 90px;
    font-size:12px
}
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
  color: #555;
  opacity: 1; /* Firefox */
  font-size: 28px;
}
::-webkit-input-placeholder {
    font-size: 18px;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
  color: #555;
}

::-ms-input-placeholder { /* Microsoft Edge */
  color: #555;
}
:-moz-placeholder {
    font-size: 28px;
}
::-moz-placeholder {
    font-size: 28px;
}

来源:https://stackoverflow.com/questions/60236529/how-to-make-placeholder-font-in-form-sizes-the-same-across-devices

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