首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >垂直形场作用怪异

垂直形场作用怪异
EN

Stack Overflow用户
提问于 2017-05-08 08:41:52
回答 1查看 76关注 0票数 0

我用以下代码创建了一个具有联系人表单7的垂直表单:

代码语言:javascript
复制
input[type="phone"]::-webkit-input-placeholder {
    -webkit-transition: opacity 0.3s linear;
    color: black;
  }
  
  input[type="phone"]:focus::-webkit-input-placeholder {
    opacity: 0;
  }
}
input[type="text"]::-webkit-input-placeholder {
  -webkit-transition: opacity 0.3s linear;
  color: black;
}
input[type="text"]:focus::-webkit-input-placeholder {
  opacity: 0;
}

.wpcf7-form-control.wpcf7-submit {
  width: 40% !important;
  text-align: center !important;
  background-color: #ff6600 !important;
  color: #0E1428 !important;
  font-family: open sans hebrew condensed;
  font-size: 20px;
  font-style: normal !important;
  font-weight: 900;
  border: 0;
  border-radius: 100em;
  display: inline-block;
  left: auto;
  right: auto;
  overflow: hidden;
  min-width: 250px;
}

@keyframes bounce {
  0%,
  20%,
  60%,
  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
  40% {
    -webkit-transform: translateY(-20px);
    transform: translateY(-20px);
  }
  80% {
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
  }
}

input[type="submit"]:hover {
  width: 40% !important;
  text-align: center !important;
  letter-spacing: 4px;
  background-color: #0E1428 !important;
  color: #ff6600 !important;
  font-family: open sans hebrew condensed;
  font-size: 20px;
  font-style: normal !important;
  font-weight: 900;
  animation: bounce 1s;
  border: 0;
  border-radius: 100em;
  display: inline-block;
  left: auto;
  right: auto;
  overflow: hidden;
  min-width: 250px;
}

body .cf7-style input[type=”text”]:focus,
body .cf7-style input[type=”email”]:focus,
body .cf7-style textarea:focus {
  transition: opacity 0.5s 0.5s ease !important;
  opacity: 0 !important;
}

[placeholder]:focus::-webkit-input-placeholder {
  transition: opacity 0.5s 0.5s ease;
  opacity: 0;
}

[placeholder] {
  width: 25% !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
  height: 40px !important;
  color: black !important;
  margin: 0 auto;
  text-align: center !important;
  border-radius: 10px !important;
  display: inline-block;
  left: auto;
  right: auto;
  font-family: open sans hebrew condensed !important;
  font-style: italic;
  border: 2px solid #0E1428 !important;
  min-width: 164px;
}

[placeholder]:focus {
  background-color: rgba(221, 221, 221, 0.8) !important;
  transition: opacity 0.5s 0.5s ease !important;
  font-family: open sans hebrew condensed !important;
  font-style: italic !important;
  border: 2px solid #ff6600 !important;
  box-shadow: 0 0 10px #719ECE !important;
  min-width: 164px;
}
代码语言:javascript
复制
<center>

  <label for=".elementor-6 .elementor-element.elementor-element-5m0lukt .wpcf7 input[type=" text "]"><input type=text textarea name="your-name" placeholder="שם" required id:name </input></label> <label for=".wpcf7-form-control.wpcf7-text.wpcf7-tel.wpcf7-validates-as-required.wpcf7-validates-as-tel* your-email"> <input type="phone" textarea name="your-phone" input placeholder="טלפון" id:phone required</input></label>  [submit "!אני רוצה עוד פרטים"]
</center>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-08 09:17:35

我查看了给出的链接,您的两个输入似乎都使用了不同的样式

首先,在HTML中,左输入有type="text",右边有type="phone"。不确定这是否正确。

如果这是正确的,那么你可以周你的CSS。似乎很少有样式不适用于type="phone"的输入,而且由于样式上的差异,正确的样式看起来不一样。

代码语言:javascript
复制
form input[type="text"], form input[type="password"], form input[type="email"], form input[type="url"], form input[type="date"], form input[type="month"], form input[type="time"], form input[type="datetime"], form input[type="datetime-local"], form input[type="week"], form input[type="number"], form input[type="search"], form input[type="tel"], form input[type="color"], form select, form textarea {
 ....
}

在上面的CSS中,如果您添加了form input[type="phone"],那么第二个CSS的行为也应该正确。

在HTML中,将第二个输入更改为type="tel"以修复(在本例中没有任何CSS更改)

代码语言:javascript
复制
<input type="tel" textarea name="your-phone" input placeholder="טלפון" id:phone required</input>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43843253

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档