Jquery HTML/CSS输入焦点超出范围
我在我的网站上有一个表单,由于某些原因,在点击表单后会自动将焦点放在第二列中的字段上。我试图找到任何可能导致它的因素,但没有任何运气。我从未见过这样的行为 你可以在这里看到表单:不再存在 任何帮助都很好 如果您需要查看css,我可以提供一个sass版本:Jquery HTML/CSS输入焦点超出范围,jquery,html,css,sass,Jquery,Html,Css,Sass,我在我的网站上有一个表单,由于某些原因,在点击表单后会自动将焦点放在第二列中的字段上。我试图找到任何可能导致它的因素,但没有任何运气。我从未见过这样的行为 你可以在这里看到表单:不再存在 任何帮助都很好 如果您需要查看css,我可以提供一个sass版本: @keyframes input-underline { 0% { left: 0; right: 0; } 50% { left: 0; right: 100%; background:
@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基金会,以防它很重要。
编辑:提供的链接不再有效,因此我删除了它们。我建议您将所有
包装在
中
然后使用以下CSS:
.table{
display:table;
}
.row{
display:table-row;
}
.row div{
display:table-cell;
}
并摆脱:
.row::before,
.row::after {
display: table;
content: ' ';
}
你有HTML吗?@Louyspatricebesette我在上图中标记了空格。事实上,我让更多的人在多台电脑上试用,他们都有同样的问题。我得到了它。。。这就是为什么我删除了我的评论。这是奇怪的,我同意。@ JAMEDSOGLAS,您可以通过浏览器中的视图源查看HTML。奇怪的是从来没有见过这样的东西,但问题是这是基础框架的一部分…但无论如何,我只是在{content:normal;}之后添加了:.contact.row::它解决了这个问题。谢谢呵。。。我懂了。好吧,我会留下我的答案。。。既然这就是它应该的样子。但是你的评论对于解决这个“基础”问题是有用的。