【发布时间】:2017-10-03 23:19:59
【问题描述】:
我的网站上有一个表格,由于某种原因,有一些空间在单击它们后会自动聚焦到第二列中的字段。我试图找到任何可能导致它但没有任何运气的元素。我从来没有见过这样的行为。
您可以在此处查看表单:不再存在
任何帮助都会很好。
如果你需要看 css 我可以提供一个 sass 版本:
@keyframes input-underline {
0% {
left: 0;
right: 0;
}
50% {
left: 0;
right: 100%;
background: #ccc;
}
51% {
background: $secondary-color;
}
100% {
background: $secondary-color;
left: 0;
right: 0;
}
}
.contact {
form {
display: block;
max-width: 100%;
label {
position: relative;
display: block;
width: 100%;
&::before {
position: absolute;
content: '';
bottom: 0;
height: 2px;
left: 0;
right: 0;
transition: background .6s linear;
background: #ccc;
}
&.active {
&::before {
animation: input-underline .6s linear forwards;
background: #ccc;
}
.input-label {
top: -16px;
font-size: .925rem;
}
}
.input-label {
position: absolute;
top: 7px;
left: 0;
transition: top .15s linear, font-size .15s linear;
z-index: -1;
}
}
.input {
display: block;
background: transparent;
width: 100%;
padding: 10px 0;
border: none;
font-family: inherit;
font-weight: $global-weight-light;
&.textarea {
min-height: auto;
height: 38px;
max-width: 100%;
max-height: 154px;
resize: none;
overflow-x: hidden;
}
}
.select, .submit {
appearance: none;
}
.submit {
display: block;
border: none;
width: 100%;
max-width: 260px;
margin: 0 auto;
padding: 10px 0;
border-radius: 4px;
box-shadow: 0 0 2px 0 #1d1d1b;
background: $secondary-color;
color: $white;
cursor: pointer;
}
}
}
这里的完整代码:不存在了
这里的JS代码:不存在了
编辑:我使用 ZURB 基金会,以防万一。 编辑:提供的链接不再有效,所以我删除了它们。
【问题讨论】:
-
你有 HTML 吗?
-
@LouysPatriceBessette 我在上图中标记了空格。我实际上要求更多人在多台 PC 上尝试它,他们都遇到了同样的问题。 i.stack.imgur.com/oE0oQ.jpg
-
我明白了...这就是我删除评论的原因。这很奇怪,我同意。
-
@JamesDouglas 您可以在浏览器中通过 View Source 查看 HTML。
-
奇怪的也没见过这样的东西