일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 프로그래머스
- .map()
- 행렬...
- JavaScript
- for문
- 소름돋는 알고리즘
- 자바스크립트의 탄생배경
- Promise.all()
- a && b
- 자바스크립트
- 삼항연산자
- 자바스크립트의 특징
- Ajax란?
- 가우스의 공식
- arr.push()
- async-await
- 구문과 의미
- 소오름~
- 어려운데ㅠㅠ
- .split()
- for반복문
- 프로그래머스 공원 산책
- 배열 최솟값
- Math.min
- 프로그래밍이란
- array.reduce()
- ES6 브라우저 지원 현황
- 자바스크립트와 ECMAScript
- !x.includes()
- 알고리즘
Archives
- Today
- Total
Ming's develop story
Chapter3 - 2주차 숙제 본문
App.js
import React from "react";
import logo from "./logo.svg";
import "./App.css";
import Start from "./Start";
function App() {
const [name, setName] = React.useState("우민기");
return (
<div
className="App"
style={{
maxWidth: "350px",
margin: "auto",
}}
>
<Start name={name} />
</div>
);
}
export default App;
|
Start.js
import React from "react";
import img from "./Teemo.png";
const Start = (props) => {
console.log(props);
return (
<div
style={{
display: "flex",
height: "100vh", //가운데에 놓기위해 높이를 지정해준다.
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
padding: "16px",
boxSizing: "border-box",
//display flex에는 가운데 정렬을 담당하는 두 친구가 있는데
//align-items: center; 세로줄 하나를 기준으로 모인다. flex가 없으면 가로기준으로 중간정렬을 해준다.
//justify-content: center;는 flex가 있을땐 위아래로 없을땐 좌우로 정렬을 해준다.
}}
>
<img
src={img}
style={{
width: "60vw",
margin: "16px",
}}
/>
<h1 style={{ fontSize: "1.5em", lineHeight: "1.5" }}>
나는{" "}
<span
style={{
backgroundColor: "#afe910",
padding: "5px 10px",
borderRadius: "30px",
}}
>
{props.name}
</span>
에 대해 얼마나 알고 있을까?
</h1>
<input
style={{
border: "1px solid #dadafc",
borderRadius: "30px",
padding: "10px",
width: "100%",
}}
/>
<button
style={{
padding: "10px 36px", //버튼크기
backgroundColor: "#dadafc",
border: "#dadafc",
borderRadius: "30px",
margin: "36px 0px",
}}
>
시작하기
</button>
</div>
);
};
export default Start;
|
이미지는 꼭 png 파일로 src 디렉토리에 넣어주기!!
결과물 - iphone X 기준으로 만들어 보았다.
'스파르타코딩클럽 - 항해99 > 항해99 Chapter3 - react 주특기 기본' 카테고리의 다른 글
Chapter3 - 라우팅(Routing)이란? (0) | 2021.11.18 |
---|---|
Chapter3 - Event Listener (0) | 2021.11.18 |
Chapter3 - 버킷리스트에 아이템 추가하기! (0) | 2021.11.18 |
Chapter3 - State 관리 (0) | 2021.11.17 |
Chapter3 - Ref를 사용해 리액트에서 돔요소 가져오기 (0) | 2021.11.17 |
Comments