【问题标题】:The input is different in FirefoxFirefox中的输入不同
【发布时间】:2013-10-29 17:29:07
【问题描述】:

所以我制作了一些用于发送消息的输入块,它在 Chrome 和 Safari 中运行良好,但 Firefox 以灰色边框显示它。 IE 中也存在问题,因为它会显示它们更大,直到您激活它,然后它会恢复到正常大小。

<form action="" method="post">
<label for="name">
<input class="input1" type="text" placeholder="Your name" name="name" id="name"/>
</label>
<label for="E-mail">
<input class="input1" type="text" placeholder="Your e-mail" id="email"/>
</label>
<label for="Subject">
<input class="input1" type="text" placeholder="Subject" id="subject" />
</label>
<label for="Message">
<textarea class="input2" name="message" rows="20" cols="20" id="message" placeholder="Message"></textarea>
</label>
<label>
</form>

CSS:

input {
    -moz-border-color: #0d1025;
    -moz-border-width:medium;
    border-color: #0d1025;
    border-width:medium;
    margin-top: 15px;
}
.input1 {
    width:300px;
    height:30px;
    display:block;
}
.input2 {
    width:650px;
    height:270px;
    margin-left:320px;
    margin-top:-143px;
    border-color: #0d1025;
    border-width:medium;
}

::-webkit-input-placeholder {
   color: #0d1025;
   font-style:italic;
   padding-left:15px;
   font-weight:bold;
}

:-moz-placeholder { /* Firefox 18- */
   color: #0d1025;  
   font-style:italic;
   padding-left:15px;
   font-weight:bold;
}

::-moz-placeholder {  /* Firefox 19+ */
   color: #0d1025;  
   font-style:italic;
   padding-left:15px;
   font-weight:bold;
}

:-ms-input-placeholder {  
   color: #0d1025;  
   font-style:italic;
   padding-left:15px;
   font-weight:bold;
}
textarea:focus, input:focus{
    outline: 0;
}

http://jsfiddle.net/h2core/taQfF/2/

我做错了什么?

【问题讨论】:

  • 谢谢!关于 IE 问题的任何想法?或者它也解决了这个问题?

标签: html css internet-explorer firefox


【解决方案1】:

您需要定义border-style: solid;,因为不同的浏览器有不同的默认值。

demo

【讨论】:

    猜你喜欢
    • 2016-03-06
    • 1970-01-01
    • 1970-01-01
    • 2016-08-08
    • 1970-01-01
    • 2013-09-06
    • 1970-01-01
    • 1970-01-01
    • 2013-04-30
    相关资源
    最近更新 更多