index.jsx
import "./square.style.css";
const Square = () => {
return <div className="square" />;
};
export default Square;
square.style.css
.square {
width: 300px;
height: 300px;
border: 1px solid blue;
background-color: blue;
}
App.js
import "./App.css";
import Square from "./components/Square";
function App() {
console.log("hello");
return (
<div className="App">
<Square />
</div>
);
}
export default App;
App.css
.App {
width: 100vw;
height: 100vh;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
[ CSS 문법 ]
중앙에 놓기