ios - iPhone上的Safari不允许将文本输入字段

标签 ios css mobile-safari textinput

我读过几个地方的CSS问题,但我不知道如何解决。

用户在网站上键入信息时,它不会显示任何文本,但是光标会像键入文本一样移动。

CSS文件

*:focus,
*:hover,
*:active {
    outline: none;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    color: #6a6f8c;
    background: #fafafa;
    font: 600 16px/18px 'Open Sans', sans-serif;
    height: auto;
}

*,
:after,
:before {
    -webkit-box-sizing: border-box;
    box-sizing: border-box
}

.clearfix:after,
.clearfix:before {
    content: '';
    display: table
}

.clearfix:after {
    clear: both;
    display: block
}

a {
    color: inherit;
    text-decoration: none
}

.login-wrap {
    width: 100%;
    margin: auto;
    max-width: 525px;
    min-height: 1070px;
    position: relative;
    background: url(https://raw.githubusercontent.com/khadkamhn/day-01-login-form/master/img/bg.jpg) no-repeat center;
    -webkit-box-shadow: 0 12px 15px 0 rgba(0, 0, 0, .24), 0 17px 50px 0 rgba(0, 0, 0, .19);
    box-shadow: 0 12px 15px 0 rgba(0, 0, 0, .24), 0 17px 50px 0 rgba(0, 0, 0, .19);
    background-size: cover;
}

.login-html {
    width: 100%;
    height: 100%;
    position: absolute;
    padding: 90px 70px 50px 70px;
    background: rgba(40, 57, 101, .9);
}

.login-html .sign-in-htm,
.login-html .sign-up-htm {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    position: absolute;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transition: all .4s linear;
    transition: all .4s linear;
}

.login-html .sign-in,
.login-html .sign-up,
.login-form .group .check {
    display: none;
}

.login-html .tab,
.login-form .group .label,
.login-form .group .button {
    text-transform: uppercase;
}

.login-html .tab {
    font-size: 22px;
    margin-right: 15px;
    padding-bottom: 5px;
    margin: 0 15px 10px 0;
    display: inline-block;
    border-bottom: 2px solid transparent;
}

.login-html .sign-in:checked+.tab,
.login-html .sign-up:checked+.tab {
    color: #fff;
    border-color: #1161ee;
}

.login-form {
    min-height: 345px;
    position: relative;
    -webkit-perspective: 1000px;
    perspective: 1000px;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.login-form .group {
    margin-bottom: 15px;
}

.login-form .group .label,
.login-form .group .input,
.login-form .group .button {
    width: 100%;
    color: #fff;
    display: block;
}

.login-form .group .input,
.login-form .group .button {
    border: none;
    padding: 15px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, .1);
}

.login-form .group input[data-type="password"] {
    text-security: circle;
    -webkit-text-security: circle;
}

.login-form .group .label {
    color: #aaa;
    font-size: 12px;
}

.login-form .group .button {
    background: #1161ee;
}

.login-form .group label .icon {
    width: 15px;
    height: 15px;
    border-radius: 2px;
    position: relative;
    display: inline-block;
    background: rgba(255, 255, 255, .1);
}

.login-form .group label .icon:before,
.login-form .group label .icon:after {
    content: '';
    width: 10px;
    height: 2px;
    background: #fff;
    position: absolute;
    -webkit-transition: all .2s ease-in-out 0s;
    transition: all .2s ease-in-out 0s;
}

.login-form .group label .icon:before {
    left: 3px;
    width: 5px;
    bottom: 6px;
    -webkit-transform: scale(0) rotate(0);
    transform: scale(0) rotate(0);
}

.login-form .group label .icon:after {
    top: 6px;
    right: 0;
    -webkit-transform: scale(0) rotate(0);
    transform: scale(0) rotate(0);
}

.login-form .group .check:checked+label {
    color: #fff;
}

.login-form .group .check:checked+label .icon {
    background: #1161ee;
}

.login-form .group .check:checked+label .icon:before {
    -webkit-transform: scale(1) rotate(45deg);
    transform: scale(1) rotate(45deg);
}

.login-form .group .check:checked+label .icon:after {
    -webkit-transform: scale(1) rotate(-45deg);
    transform: scale(1) rotate(-45deg);
}

.login-html .sign-in:checked+.tab+.sign-up+.tab+.login-form .sign-in-htm {
    -webkit-transform: rotate(0);
    transform: rotate(0);
}

.login-html .sign-up:checked+.tab+.login-form .sign-up-htm {
    -webkit-transform: rotate(0);
    transform: rotate(0);
}

.hr {
    height: 2px;
    margin: 60px 0 50px 0;
    background: rgba(255, 255, 255, .2);
}

.foot-lnk {
    text-align: center;
}

.fullwidth {
    width: 100%;
}

.fulheight {
    height: 100%;
}

.main {
    background: #fafafa;
    padding: 15px;
}

.btn__grp button:last-child {
    margin-right: 15px;
}

.blank_input_hack {
    height: 0;
    width: 0;
    opacity: 0;
}

.input option {
    color: black;
}

#promoForm {
    max-width: 600px;
    margin: 0 auto;
}


/*.tooltip.ng-scope.ng-isolate-scope.top.fade.in{
    word-break: break-word;
}*/

.color-box>div {
    display: inline-block;
    margin-bottom: 15px;
}

.color-box>div:not(:last-child) {
    margin-right: 3px;
}

.color-box>div label {
    margin: 0;
    padding: 3px;
    border: solid 1px #979797;
}

.btn.pull-right {
    margin-right: 10px;
}

#user {
    text-transform: lowercase;
}

input,
textarea {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

table tr th {
    background: #337ab7;
    color: white;
    text-align: left;
    vertical-align: center;
}

该网站是https://braindrain.developmentserver.me

最佳答案

我想我已经找到了解决方案。一个不错的提示,如果您不知道这些,可以通过USB将iPhone插入Mac并远程使用Web检查器。我发现您在用户名输入表单之前有一个div,带有blank_input_hack类。一旦删除了此内容,输入就可以完美,样式化地工作了。不知道为什么会首先出现在这里,但是您去了!希望这可以帮助!

关于ios - iPhone上的Safari不允许将文本输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50900578/

相关文章:

ios - 使用 iCarousel 正确显示另一个 Storyboard 中的 Controller View

ios - 当 iframe 嵌入另一个站点时,cookie 在 iPhone 上是否有效?

html - 如何在 Mobile Safari/iPad 中设置表单选择框的宽度?

html - map 覆盖了切换按钮

javascript - 用JS只显示png的某一部分叫什么?

html - 隐藏在主图像后面的背景图像

ios - 我如何修复 safari 6 网络检查器,使其与 iOS 设备或模拟器一起工作?

ios - 使用 AVAudioPlayer 开始/停止背景音乐按钮

ios - 有没有办法在不快速使用 NSAttributedString 类的情况下创建属性字符串?

ios - 关于 iOS 辅助功能。如何将焦点转移到 pickerView