์ผ์ข
์ ๋ฐ์ค
๊ฐ๋
ํ๋์ ํฐ ๋ฐ์ค
๋ฅผ ๋ง๋ค์ด์ฃผ๊ณ ์ถ์ ๋ div๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค.
div className
: div์ ์คํ์ผ์ ์ ์ฉ์์ผ์ฃผ๊ณ ์ถ์ ๋ ์ฌ์ฉํ๋ค.div class
์ ๋ค๋ฅด๋ค๋ ๊ฒ์ ๊ธฐ์ตํ์.<div className="App"> </div>
โฅ App.css ํ์ผ ์์ ๋ฑ๋ก๋์ด ์๋ App์ด๋ผ๋ ์ด๋ฆ์ ์คํ์ผ์ ๊ฐ์ ธ์์ ์ ์ฉ์ํจ๋ค.
.App {
text-align: center;
}
import './ํ์ผ๋ช
.css';
: css ํ์ผ์ ์ฌ์ฉํด์ฃผ๊ธฐ ์ํด์๋ ํ์ผ๋ช
.js
์๋จ์ import๋ฅผ ๊ผญ ํด์ฃผ์ด์ผ ํ๋ค!import './App.css';
โฅ ์์ ํด๋ ์ค App.css ํ์ผ์ ๋ถ๋ฌ์จ๋ค๋ ์๋ฏธ์ด๋ค.
<div className = "nav"> </div>
{์ค๊ดํธ}
: ๋ณ์์ ์ ์ฅ๋์ด ์๋ ๋ฌธ์(ํน์ ๊ธฐํ ์๋ฃ๋ค)๋ฅผ html ์ฌ์ด์ ๋ฃ๊ณ ์ถ์ผ๋ฉด ์ค๊ดํธ ๋ฌธ๋ฒ์ ์ฌ์ฉํ๋ฉด ๋๋ค.let a = 'hello world'
...
<h4> { a } </h4>
<h4 id = { a } > </h4>
โฅ ๋์ ์ฝ๋๋ ๊ฐ์ ์ฝ๋!
style = { {์คํ์ผ๋ช
: '๊ฐ'} }
<h4 style={ {color:'white', fontsize:'16px'} }> nav์
๋๋ค. </h4>
div๋ฅผ ์ด์ฉํด navbar ๋ง๋ค๊ธฐ
App.css
.App{
text-align: center;
}
.nav{
display:flex;
background: blue;
width: 100%;
color: white;
padding-left: 20px;
}
App.js
import './App.css';
function App() {
let a = 'nav'
return (
<div className="App">
<div className="nav">
<h4 style={ {color:'white', fontsize:'16px'} }> nav์
๋๋ค. </h4>
</div>
<div>
<p> ๋ฐ์ดํฐ ๋ฐ์ธ๋ฉ ์ฌ์ฉํ๋ฉด! {a} </p>
</div>
</div>
);
}
export default App;