由於某種原因,CSS樣式不適用於React模式。任何理由?爲什麼css風格不適用於模態?
render() {
return (
<div>
<Modal defaultOpen={this.props.isShowing} className="openmodal">
</Modal>
</div>
);
}
CSS文件
.openmodal{
text-align: center;
background-color: black;
border-radius: 0;
width: 400px;
position: relative;
}
呈現的HTML看起來像什麼?那裏有任何線索? – Serlite
其中是.openmodal代碼放置?在.css文件中,或者直接在render函數下面,就像你提供的代碼一樣? –
可能是因爲Modal沒有將className作爲屬性。分享更多的代碼,以便我們弄清楚。 – Erik