【发布时间】:2017-01-03 06:08:48
【问题描述】:
<div>
<h3>{this.props.product.name}</h3>
<h3>{this.props.product.code}</h3>
{this.renderColors()}
<article>
<div dangerouslySetInnerHTML={this.createMarkup(this.props.product.description)} />
</article>
</div>
这是反应渲染对象,我想使用 CSS 设置样式。有没有办法做到这一点?这个 html 文件有一个单独的 css 文件。
【问题讨论】:
-
由于您没有提及是否为必要的元素创建了单独的模块/组件,请查看这篇优秀的文章。 css-tricks.com/css-modules-part-3-react
标签: javascript html css reactjs