-
React 기본 css 제거하기React/React 2023. 2. 25. 16:16
📌 React 에서 html 을 작성할때 기본적으로 적용되어 있는 css 를 모두 제거 하고 싶다.
방법은 2가지
1.reset .css 를 App.jsx 에 추가한다.
reset.css
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; box-sizing: border-box; } /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body { line-height: 1; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } table { border-collapse: collapse; border-spacing: 0; }
2. 터미널에 npm install styled-reset 설치 후 <Reset /> 사용
import { Reset } from "styled-reset"; ...중략 <Reset />
'React > React' 카테고리의 다른 글
useState 바로 뒤에 console.log 를 했더니 이전 값이 나온다.(혹은 비어있다) (0) 2023.03.07 React Outlet 적용하기 (0) 2023.02.26 React useParams() 사용법 (0) 2023.02.23 React Router 버전 5 , 6 문제 해결 및 차이점 (react-router-dom) (0) 2023.02.23 useEffect 에서 return 문을 왜 쓰이는걸까? (0) 2023.02.14