ios - 此按钮上的样式未显示在移动设备 (iOS) 上

标签 ios html css

Here is what it looks like在移动版 Safari 和 Chrome(iPhone 5c、iOS8)上。

This is它应该是什么样子。

点击按钮后:悬停状态开始工作。

这是我的代码。虽然在 Android 5.1 上的 Chrome 上工作正常。奇怪(对我来说)。

@import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);

}
#feedback-page {
  text-align: center;
}
#form-main {
  width: 100%;
  float: left;
  padding-top: 0px;
}
#form-div {
  background-color: rgba(72, 72, 72, 0.4);
  padding-left: 25px;
  padding-right: 25px;
  padding-top: 10px;
  padding-bottom: 10px;
  width: 450px;
  float: left;
  left: 50%;
  position: absolute;
  margin-top: 15px;
  margin-left: -260px;
  -moz-border-radius: 7px;
  -webkit-border-radius: 7px;
}
.feedback-input {
  color: #3c3c3c;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 18px;
  border-radius: 0;
  line-height: 22px;
  background-color: #fbfbfb;
  padding: 13px 13px 13px 54px;
  margin-bottom: 10px;
  width: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
  border: 3px solid rgba(0, 0, 0, 0);
}
.feedback-input:focus {
  background: #fff;
  box-shadow: 0;
  border: 3px solid #db1d1d;
  color: #3c3c3c;
  outline: none;
  padding: 13px 13px 13px 54px;
}
.focused {
  color: #db1d1d;
  border: #db1d1d solid 3px;
}
/* Icons ---------------------------------- */

#name {
  background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
  background-size: 30px 30px;
  background-position: 11px 8px;
  background-repeat: no-repeat;
}
#name:focus {
  background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
  background-size: 30px 30px;
  background-position: 8px 5px;
  background-position: 11px 8px;
  background-repeat: no-repeat;
}
#email {
  background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
  background-size: 30px 30px;
  background-position: 11px 8px;
  background-repeat: no-repeat;
}
#email:focus {
  background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
  background-size: 30px 30px;
  background-position: 11px 8px;
  background-repeat: no-repeat;
}
#comment {
  background-image: url(http://rexkirby.com/kirbyandson/images/comment.svg);
  background-size: 30px 30px;
  background-position: 11px 8px;
  background-repeat: no-repeat;
}
textarea {
  width: 100%;
  height: 150px;
  line-height: 150%;
  resize: vertical;
}
input:hover,
textarea:hover,
input:focus,
textarea:focus {
  background-color: white;
}
#button-red {
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  float: left;
  width: 100%;
  border: #fbfbfb solid 4px;
  cursor: pointer;
  background-color: #db1d1d;
  color: white;
  font-size: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  transition: all 0.3s;
  margin-top: -4px;
  font-weight: 700;
}
#button-red:hover {
  background-color: rgba(0, 0, 0, 0);
  color: #db1d1d;
}
.submit:hover {
  color: #db1d1d;
}
.ease {
  width: 0px;
  height: 74px;
  background-color: #fbfbfb;
  -webkit-transition: .3s ease;
  -moz-transition: .3s ease;
  -o-transition: .3s ease;
  -ms-transition: .3s ease;
  transition: .3s ease;
}
.submit:hover .ease {
  width: 100%;
  background-color: white;
}
@media only screen and (max-width: 580px) {
  #form-div {
    left: 3%;
    margin-right: 3%;
    width: 88%;
    margin-left: 0;
    padding-left: 3%;
    padding-right: 3%;
  }
}
<div id="form-main">
  <div id="form-div">
    <form action="//formspree.io/emailemailemail@gmail.com" method="POST" class="form" id="form1">

      <p class="name">
        <input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
      </p>
      <input type="text" name="_gotcha" style="display:none" />
      <p class="email">
        <input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
      </p>

      <p class="text">
        <textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
      </p>


      <div class="submit">
        <input type="submit" value="SEND" id="button-red" />
        <div class="ease"></div>

      </div>
      <input type="hidden" name="_next" value="{{store_url}}/page/thanks" />
    </form>
  </div>

最佳答案

您应该将以下内容添加到您的#button-red 样式中:

-webkit-appearance: none;
-webkit-border-radius: 0;
border-radius: 0;

这应该覆盖按钮的任何 iOS 特定浏览器样式。 包含的 CSS 文件中可能存在一些现有的 CSS 定义,因此出于调试目的,您可以尝试使用 !important 语句。

关于ios - 此按钮上的样式未显示在移动设备 (iOS) 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34752490/

相关文章:

ios - 无法滚动到 UIScrollView 中嵌入的 UITableView 的顶部

ios - 当用户将手指拖动到新 View 时,如何在不同 View 上注册触摸?

html - Facebook 元标签搞砸了 w3c 验证

javascript - 使用 CSS 或 SVG 填充字体的 'empty' 部分的最简单方法

HTML/CSS-如何将单元格的一部分左对齐,一部分右对齐?

html - hovering::before 伪元素(不是宿主元素)时如何在::after 伪元素上应用样式?

ios - 从 Objective C 类加载包

html - 如何将图像添加到 <p> 并在 UIWebView 中使用?

asp.net - Asp.net Themes 提供了哪些精心设计的 CSS 没有提供的功能?

ios - AVCaptureVideoPreviewLayer 旋转不起作用