2013-12-22 21 views
-1

我试图设计我的<input>场的样式,但它们不适用于CSS。无法让我的<input>-场与CSS一起工作

CSS:

input { 
border:1px solid #0066BB; 
backround-color:#111; 
-webkit-appearence:none; 
} 

HTML:

<input type="text"><br> 
<input type="text"><br> 
<input type="text"><br> 
<input type="text"><br> 
<input type="text"><br> 
<input type="text"><br> 
<input type="text"><br> 
+4

两个拼写错误'backround-color'应该是'background-color','-webkit-appearence:none'应该是'-webkit-appearance:none'。 [修复这些,它的工作原理](http://jsfiddle.net/davidThomas/GSc89/)。 –

+0

@DavidThomas你应该把这个作为答案,你是正确的http://jsfiddle.net/TMxtP/ –

回答

0

只是给你输入一个类,并修改你的CSS这个类。

.uniqueInputs{ 
    border:1px solid #0066BB; 
    background-color:#111; 
    -webkit-appearance:none; 
} 

并输入自己

<input class="uniqueInputs" type="text"><br> 
+1

作为@大卫托马斯说之前的错误是由于一些错别字。即背景色:#111;应该是背景颜色。你的“解决方案”不会因为这些错别字而起作用。 –

+0

是的,这也有帮助...“编辑” – TGammage

+0

'
'不再比'
'有效;额外的'/'实际上在HTML解析中显式忽略。请参阅http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-br-element和http://www.whatwg.org/specs/web -apps/current-work/multipage/syntax.html#syntax-start-tag第6步。我将编辑你的答案以消除这种不准确性。 – Domenic

0

只是给他们一个类,如:

<input type="text" class="inputs"/> 

.input{ 
    border:1px solid #0066BB; 
    backround-color:#111; 
    -webkit-appearence:none; 
} 

或类型选择它们

<input type="text"/> 

input[type=text]{ 
    border:1px solid #0066BB; 
    backround-color:#111; 
    -webkit-appearence:none; 
} 
+0

出于某种原因,您已经保留了“外观”错字。 –

1

只是更正拼写错误背景:

input { 
border:1px solid #0066BB; 
background-color:#111; 
-webkit-appearence:none; 
} 
+0

* * *出现错误(第三个元音应该是'a',而不是'e')。 –