【问题标题】:Wordpress form input css displaying differently in Firefox and ChromeWordpress 表单输入 css 在 Firefox 和 Chrome 中显示不同
【发布时间】:2013-04-22 01:21:56
【问题描述】:

我正在尝试编写一个电子邮件选择框,我已经安装了一个主题并且正在使用 Wordpress。该框在 Firefox 中看起来应该如此,但在 Chrome 中显示不正确,包括文本字段中没有填充,文本字段中的字体颜色不同,2px-ish 填充不应位于蓝色提交按钮的上方和下方。

包含!important没有效果。

网站是http://shannonconfairphotography.com,框在页面顶部,在firefox中显示很好。通常我看不出 Chrome 和 Firefox 之间有什么区别,只有 IE,所以我很难过。

箱码为:

<div style="background-color:#efefef; padding:0; margin:0; -webkit-box-sizing:content-box !important; -moz-box-sizing:content-box !important; box-sizing:content-box !important;">
<span style="font-family: 'Rouge Script', cursive; font-size:30px; line-height:16px; color:#8e8e8e; margin-right:15px; padding-left:15px;"> 5 easy ways to save money on your wedding...</span>
 <form style="display:inline; margin:0px; padding:0px; height:100%;" action="https://madmimi.com/signups/" method="post" target="_blank"> 
    <input style="display:inline; margin:0px; font-family: 'Rouge Script', cursive; font-size:28px; line-height:22px; height:40px; border:none; color:#acacac; background-color:#fff; width:200px; padding-left:10px; margin-right:5px;" id="signup_first_name" name="signup[first_name]" type="text" placeholder="first name">
    <input style="display:inline; margin:0px; font-family: 'Rouge Script', cursive; font-size:28px; line-height:22px; height:40px; border:none; color:#acacac; background-color:#fff; width:200px; padding-left:10px; margin-right:11px;" name="signup[email]" type="text" placeholder="email"> 
    <input style="background-image:none; border: none; background-color:#023972; color:#fff; font-family: 'Rouge Script', cursive; font-size:28px; padding:10px;" value="get it!" type="submit" class="submit"> 
  </form>
  </div>

【问题讨论】:

    标签: css wordpress


    【解决方案1】:

    &lt;input&gt; 样式中删除line-height: 22px; 行似乎可以更正文本的位置。

    尝试使用::-webkit-input-placeholder { color: [your color]; } 更改Chrome 中输入占位符文本的颜色。

    【讨论】:

    • 谢谢!我想你不知道为什么 Chrome 中的蓝色按钮周围有大约 2px 的边距,但在 Firefox 中没有(我不想要额外的空间)。此外,我似乎无法覆盖文本输入颜色的现有主题 css。也许 !important 不起作用,因为我没有使用单独的 css 文件,而是将其全部放在 style=".." 而不是 class=".." 下?再次感谢。
    • 哦,我会投票给你,但我没有声誉(就像 irl),哈哈 ;)
    • 不确定是什么创建了边距,但如果您设置边距:0;它摆脱了它。您的主题中调用了很多样式表,因此很难确定与::-webkit-input-placeholder { color: [your color]; } 的冲突。尝试将其添加到 HTML 中:&lt;style type="text/css"&gt; ::-webkit-input-placeholder { color: #ddd; } input { margin: 0; } &lt;/style&gt;
    • 哇,再次感谢。一切都解决了!快速提问(如果我可以)(我并不尴尬地说,经过 6 年的网站设计,css 仍然让我感到困惑):为什么你的输入 {margin: 0;} 在我有
      嗯,很难说——我实际上对 &lt;input&gt; 字段和内联 CSS 没有太多经验,所以不确定问题可能是什么。但很高兴有帮助:)
    猜你喜欢
    • 2013-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-27
    • 2013-05-11
    • 2010-10-16
    • 1970-01-01
    相关资源
    最近更新 更多