ReactでCSSを使用する方法
1974 ワード
コンポーネントが外部からcssファイルを導入する必要はなく、コンポーネントに直接書く.
import React, { Component } from "react";const div1 = {
width: "300px",
margin: "30px auto",
backgroundColor: "#44014C", //
minHeight: "200px",
boxSizing: "border-box"};
class Test extends Component {
constructor(props, context) {
super(props);
}
render() {
return (
123
);
}}
export default Test;
:
css , background-color,box-sizing , style div1 ,
backgroundColor,boxSizing。 , margin,width , style 。