๋ณธ๋ฌธ์œผ๋กœ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

CSS Reset ์ด๋ž€?

์›น ๋ธŒ๋ผ์šฐ์ €๋งˆ๋‹ค ๊ธฐ๋ณธ ์ œ๊ณตํ•˜๋Š” CSS ์Šคํƒ€์ผ(์—ฌ๋ฐฑ, ๊ธ€์ž ํฌ๊ธฐ, ํ…Œ์ด๋ธ” ๊ฐ„๊ฒฉ ๋“ฑ)์ด ์กฐ๊ธˆ์”ฉ ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์—, ๊ฐ™์€ HTML์„ ์ž‘์„ฑํ•ด๋„ ํฌ๋กฌ·ํŒŒ์ด์–ดํญ์Šค·์‚ฌํŒŒ๋ฆฌ ๋“ฑ์—์„œ ๋ชจ์–‘์ด ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค.
์ด๋ฅผ ํ†ต์ผํ•˜๊ธฐ ์œ„ํ•ด CSS Reset์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.

๋Œ€ํ‘œ์ ์œผ๋กœ ๋งŽ์ด ์“ฐ์ด๋Š” ๊ฒƒ์ด Eric Meyer์˜ Reset CSS์ž…๋‹ˆ๋‹ค.

 

์ ์šฉ๋ฐฉ๋ฒ•

1. ์ง์ ‘ ํŒŒ์ผ๋กœ ๋„ฃ๊ธฐ

  1. ํ”„๋กœ์ ํŠธ css ํด๋”์— reset.css ์ €์žฅ
  2. HTML <head>์— ๋งํฌ ์ถ”๊ฐ€

Eric Meyer’s Reset CSS (v2.0)

https://meyerweb.com/eric/tools/css/reset/

 

CSS Tools: Reset CSS

CSS Tools: Reset CSS The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on. The general reasoning behind this was discussed in a May 2007 post, if you're inter

meyerweb.com

 

/* 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;
}
/* 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. CDN์œผ๋กœ ์—ฐ๊ฒฐํ•˜๊ธฐ

์ง์ ‘ ํŒŒ์ผ์„ ๋‘์ง€ ์•Š๊ณ , ์™ธ๋ถ€ CDN ๋งํฌ๋ฅผ ๋ถˆ๋Ÿฌ์™€ ๋ฐ”๋กœ ์ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

<!-- Eric Meyer Reset CSS CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/filipelinhares/ress/dist/ress.min.css">
์ฐธ๊ณ : Meyer์˜ ์›๋ณธ reset.css๋Š” ๊ณต์‹ CDN์ด ์—†์ง€๋งŒ, ress.css (reset+normalize ์„ฑ๊ฒฉ) ๋“ฑ ๋Œ€์ฒด์žฌ๋ฅผ CDN์œผ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋‹จ์ˆœํžˆ Reset๋งŒ ํ•„์š”ํ•˜๋‹ค๋ฉด ์œ„ ress.min.css๋ฅผ ์“ฐ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

Reset vs Normalize ์ฐจ์ด

  • Reset CSS: ๋ชจ๋“  ๋ธŒ๋ผ์šฐ์ € ๊ธฐ๋ณธ ์Šคํƒ€์ผ์„ ๋‚ ๋ ค๋ฒ„๋ฆฌ๊ณ , ์™„์ „ํžˆ ์ดˆ๊ธฐํ™” → ๊ฐœ๋ฐœ์ž๊ฐ€ ์Šคํƒ€์ผ์„ ์ฒ˜์Œ๋ถ€ํ„ฐ ์ „๋ถ€ ์ •์˜ํ•ด์•ผ ํ•จ.
  • Normalize CSS: ๋ธŒ๋ผ์šฐ์ € ๊ฐ„ ์ฐจ์ด๋ฅผ ์ค„์ด๋Š” ๋ฐฉํ–ฅ์œผ๋กœ ๊ธฐ๋ณธ ์Šคํƒ€์ผ์„ ์กฐ์ • → ์ข€ ๋” ํ˜„์‹ค์ ์ธ ์ ‘๊ทผ.
๋ฐ˜์‘ํ˜•