[TIL] Reset CSS

Sohee Yeoยท2022๋…„ 4์›” 6์ผ
1

TIL

๋ชฉ๋ก ๋ณด๊ธฐ
13/23
post-thumbnail

2022.04.06 Today I Learned๐Ÿ“š

CSS๋ฅผ ์™œ Reset ํ•ด์•ผํ• ๊นŒ?

๋ธŒ๋ผ์šฐ์ €๋งˆ๋‹ค ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋ณธ ์Šคํƒ€์ผ์ด ๊ฐ๊ธฐ ๋‹ค๋ฅด๋‹ค. ๋งŒ์•ฝ ์–ด๋–ค ๋””์ž์ธ์„ ๊ตฌํ˜„ํ•ด์•ผ ํ•œ๋‹ค๋ฉด, ๊ฐ ๋ธŒ๋ผ์šฐ์ €์— ๋”ฐ๋ผ ๋‹ค๋ฅธ ์Šคํƒ€์ผ์„ ๋ถ€์—ฌํ•ด์•ผํ•˜๋Š” ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธด๋‹ค. ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ, ๊ฐ™์€ ์Šคํƒ€์ผ๊ฐ’์„ ์ ์šฉํ•˜์—ฌ๋„ ๊ฐ ๋ธŒ๋ผ์šฐ์ €๋งˆ๋‹ค ๊ตฌํ˜„๋˜๋Š” ๋””์ž์ธ์ด ๋‹ค๋ฅผ ์ˆ˜ ์žˆ๋‹ค. ๊ทธ๋ ‡๊ธฐ ๋•Œ๋ฌธ์— ๋ธŒ๋ผ์šฐ์ €์˜ ๊ธฐ๋ณธ CSS๊ฐ’๋“ค์„ ์ดˆ๊ธฐํ™”์‹œ์ผœ ๋ชจ๋“  ๋ธŒ๋ผ์šฐ์ €์—์„œ ๋˜‘๊ฐ™์€ ํ™”๋ฉด์ด ๊ตฌํ˜„๋˜๋„๋ก ํ•ด์•ผํ•œ๋‹ค.

์—๋ฆญ ๋งˆ์ด์–ด์˜ reset CSS

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

๋งค์šฐ ์˜ค๋ž˜์ „๋ถ€ํ„ฐ ๋„๋ฆฌ ์‚ฌ์šฉ๋œ ๋ฐฉ๋ฒ•. ๋ธŒ๋ผ์šฐ์ €์˜ ๋ชจ๋“  ๊ธฐ๋ณธ ์Šคํƒ€์ผ ์†์„ฑ๋“ค์„ ์ดˆ๊ธฐํ™” ์‹œ์ผœ ๋ชจ๋“  ์Šคํƒ€์ผ์„ ์ฒ˜์Œ๋ถ€ํ„ฐ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค. reset.css ์ฝ”๋“œ๋ฅผ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๊ณ , ์—ฌ๊ธฐ์— ์ปค์Šคํ…€ ์Šคํƒ€์ผ์„ ์ถ”๊ฐ€ํ•ด์„œ ์‚ฌ์šฉํ•˜๊ธฐ๋„ ํ•œ๋‹ค. ํ•˜์ง€๋งŒ 2011๋…„ ์ดํ›„๋กœ ์—…๋ฐ์ดํŠธ๊ฐ€ ์ค‘๋‹จ๋˜์—ˆ๋‹ค.

/* 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;
}

normalize.css

https://necolas.github.io/normalize.css/

๋ธŒ๋ผ์šฐ์ €์˜ ๊ธฐ๋ณธ์ ์ธ ์Šคํƒ€์ผ ์†์„ฑ๋“ค์„ ๋ชจ๋‘ ์ œ๊ฑฐํ•˜์ง€ ์•Š๋Š”๋‹ค. ๋Œ€์‹  ๋ธŒ๋ผ์šฐ์ € ์Šคํƒ€์ผ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•˜๊ณ  ๊ฑฐ๊ธฐ์— ์ถ”๊ฐ€์ ์ธ ์Šคํƒ€์ผ์„ ๋ง๋ถ™์—ฌ ์–ด๋–ค ๋ธŒ๋ผ์šฐ์ €์—์„œ๋“  ๋น„์Šทํ•˜๊ฒŒ ๋ณด์ด๋„๋ก ํ†ต์ผํ•ฉ๋‹ˆ๋‹ค. (ํ•˜์ง€๋งŒ ์™„์ „ํžˆ ๋˜‘๊ฐ™์ด ๋งŒ๋“œ๋Š”๊ฒƒ์€ ์•„๋‹˜!)

CSS Remedy

https://github.com/jensimmons/cssremedy

์ฐจ์„ธ๋Œ€ CSS reset ํ”„๋กœ์ ํŠธ์ด๋‹ค. ๋‹จ์ˆœํžˆ ์Šคํƒ€์ผ๋งŒ ์ƒ๊ฐํ•˜๋Š”๊ฒƒ์ด ์•„๋‹Œ, ํ•˜์œ„ ๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜ ๊ฑฑ์ •์—†์ด CSS๊ฐ€ ๋ธŒ๋ผ์šฐ์ €์—์„œ ํšจ์œจ์ ์œผ๋กœ ์ž‘๋™ํ•˜๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด ๋ชฉํ‘œ์ด๋‹ค.
์ด ํ”„๋กœ์ ํŠธ๋Š” ์•„์ง ์ง„ํ–‰์ค‘์ด๋ฉฐ, ์™„์ „ํ•œ ๋ฉ”์ด์ € ๋ฒ„์ „์€ ์–ธ์ œ ๋‚˜์˜ฌ์ง€ ์•„์ง ์•Œ ์ˆ˜ ์—†๋‹ค.

profile
์‹คํŒจ์— ๋ฌด๋”˜ ์‚ฌ๋žŒ. ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์ž๋ฅผ ๊ฟˆ๊ฟ‰๋‹ˆ๋‹ค

2๊ฐœ์˜ ๋Œ“๊ธ€

comment-user-thumbnail
2022๋…„ 4์›” 6์ผ

๋‹ค๋“ค... ์‹œ๊ฐ„์ด ์ง€๋‚ ์ˆ˜๋ก ๊ธ€ ์“ฐ์‹œ๋Š” ์†œ์”จ๊ฐ€ ํ›Œ๋ฅญํ•ด์ง€๋„ค์š”!! ์ €๋„ ์—ด์‹ฌํžˆ ๋ฐฐ์›Œ์•ผ๊ฒ ์–ด์š”๐Ÿ˜Š๐Ÿ˜Š

1๊ฐœ์˜ ๋‹ต๊ธ€