๐Ÿง€๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป 01. Reset CSS

4111 ๋‹จ์–ด CSSCSS

Reset CSS๋ž€โ“

  • ์›น ๋ธŒ๋ผ์šฐ์ €๋งˆ๋‹ค ๊ฐ๊ธฐ ๋‹ค๋ฅธ default ์Šคํƒ€์ผ์ด ์ง€์ •๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด๋ฅผ ์ดˆ๊ธฐํ™”ํ•จ์œผ๋กœ์จ ๋‹ค์–‘ํ•œ ์›น ๋ธŒ๋ผ์šฐ์ € ํ™˜๊ฒฝ์—์„œ ๋™์ผํ•œ ์Šคํƒ€์ผ์ด ์ ์šฉ๋˜๋„๋ก ํ•˜๋Š” ์„ค์ •!
  • W3C์—์„œ ๊ณต์‹์ ์œผ๋กœ ๊ถŒ์žฅํ•˜๋Š” ๊ธฐ๋ฒ•์ด๊ธฐ ๋ณด๋‹จ ์‹ค๋ฌด์—์„œ ํŽธ์˜์— ์˜ํ•ด ์ž„์˜๋กœ ์ง€์ •ํ•˜๋Š” ์„ค์ •!

Normalize (์ •๊ทœํ™”) ๋ฐฉ๋ฒ•

Reset CSS์€ ์—ฌ๋Ÿฌ ๋ฐฉ๋ฒ•์ด ์žˆ์œผ๋‚˜, ์ตœ๊ทผ์—๋Š” normalize.css๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•จ
CDN ๊ธฐ๋ฒ•์„ ํ†ตํ•ด ๋งํฌ๋กœ ์ ์šฉ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Œ : https://cdnjs.com/libraries/normalize

CDN ๊ธฐ๋ฒ•โ“ CDN์€ ์›๋ณธ ์ฝ˜ํ…์ธ ๊ฐ€ ์ €์žฅ๋œ ์„œ๋ฒ„ ๋Œ€์‹  ์‚ฌ์šฉ์ž์™€ ๋ฌผ๋ฆฌ์ ์œผ๋กœ ๊ฐ€๊นŒ์šด ๋„คํŠธ์›Œํฌ ์œ„์น˜์—์„œ ์บ์‹ฑ๋œ ๋ฒ„์ „์œผ๋กœ ์›น ์ฝ˜ํ…์ธ  ์š”์ฒญ์— ์‘๋‹ตํ•จ์œผ๋กœ์จ ์ฝ˜ํ…์ธ  ์„œ๋ฒ„์˜ ํŠธ๋ž˜ํ”ฝ์„ ๋ถ„์‚ฐํ•˜๊ณ  ์›น ๊ฒฝํ—˜์„ ํ–ฅ์ƒํ•จ!

์ ์šฉ ๋ฐฉ๋ฒ• : <head></head> ์•ˆ์— ์•„๋ž˜ ์Šคํฌ๋ฆฝํŠธ ์ถ”๊ฐ€ํ•˜์—ฌ ์ ์šฉ!

  • RESET CSS์— ์ถ”๊ฐ€ํ•  CSSํšจ๊ณผ๊ฐ€ ์žˆ๋‹ค๋ฉด normalize.css๋ฅผ ๋‹ค์šด๋ฐ›์•„ ์ถ”๊ฐ€๋กœ ์ž‘์„ฑํ•ด๋„ ๋˜๊ณ , ์••์ถ•๋œ RESET CSS๊ฐ€ ํ•„์š”ํ•˜๋ฉด min.css๋ฅผ CDN ๋˜๋Š” ๋‹ค์šด๋ฐ›์•„ ์‚ฌ์šฉ
  • Normalize RESET CSS์˜ ํŠน์ง•์€ ๊ธฐ๋ณธ ์Šคํƒ€์ผ์€ ๋‚จ๊ฒจ๋‘๊ณ , ๋ธŒ๋ผ์šฐ์ € ๋ณ„๋กœ ๋‹ค๋ฅธ ์Šคํƒ€์ผ๋งŒ ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ ์šฉ๋จ (์ฆ‰, ๋ชจ๋“  ํšจ๊ณผ๋ฅผ RESET ์‹œํ‚ค๋Š” ๊ฒƒ์ด ์•„๋‹˜)
๐Ÿ’ป html code

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
  </head>
  <body></body>
</html>

RESET CSS ํŒŒ์ผ

๐ŸŒŸ RESET CSS ํŒŒ์ผ์„ import ์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค!

  • ํŒŒ์ผ๋กœ ๋œ RESET CSS๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์€ main์ธ cssํŒŒ์ผ์— import ์‹œ์ผœ ์ ์šฉโ—๏ธ
  • import ๋ฐฉ๋ฒ• : @import "reset.css";
๐Ÿ’ป RESET CSS

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;
}
/* 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;
}
input:focus {
  outline: none;
}
a {
  color: inherit;
  text-decoration: none;
}

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ