-1
我試圖讓一些CSS屬性出現在我的窗體中,但是當我將屬性移動到父html元素時,它不起作用。 的CSS屬性直接應用於.input
類的工作,但是當應用於父.form-control
類,他們不工作,似乎並沒有影響到.form-control
性的輸入和沒有出現在Chrome瀏覽器開發工具,如果我檢查文本輸入元素?沒有出現在文本輸入上的CSS屬性
.form-control {
display: inline-block;
height: 34px;
width: 100%;
margin: 10px;
border-radius: 4px;
border: 1px solid #ccc;
}
/*.form-control .input {*/
/*height: 34px;*/
/*width: 100%;*/
/*margin: 10px;*/
/*border-radius: 4px;*/
/*border: 1px solid #ccc;*/
/*}*/
.form-control .button {
display: block;
background-color: limegreen;
font-size: 14px;
font-weight: 400;
color: white;
margin: auto;
vertical-align: middle;
padding: 6px 12px;
border: 1px solid transparent;
height: 25px;
border-radius: 4px;
}
<form className="form-control">
<input className="input" type="text" />
<button className="button">Get Weather</button>
</form>
why className =「」and not class =「」? –
很可能是因爲OP採用陣營:https://facebook.github.io/react/docs/dom-elements.html – Terry
是抱歉,我應該怎麼用陣營增加了。 – Yunti