๐Ÿ’ปCoding/๐Ÿ“’ CSS

[css] CSS ์Šคํƒ€์ผ ์ œ๊ฑฐ : reset CSS (๊ธฐ๋ณธ ์Šคํƒ€์ผ ์ง€์šฐ๊ธฐ)

์Œ์€์‘ 2022. 8. 28. 13:01
728x90
๋ฐ˜์‘ํ˜•

 

CSS ์Šคํƒ€์ผ ์ œ๊ฑฐ
: reset CSS
(๊ธฐ๋ณธ ์Šคํƒ€์ผ ์ง€์šฐ๊ธฐ)

 

โœ… ์ƒํ™ฉ
→ html ํƒœ๊ทธ์™€ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ ์šฉ๋˜๋Š” ๋ธŒ๋ผ์šฐ์ € ๊ธฐ๋ณธ ์Šคํƒ€์ผ์„ ์ œ๊ฑฐ ํ•˜๊ณ  ์‹ถ์„ ๋•Œ

โœ… ๋ฐฉ๋ฒ•
css์—์„œ ์Šคํƒ€์ผ์„ ์ œ๊ฑฐํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์ ์šฉํ•ด์ค๋‹ˆ๋‹ค.

โœ… ์ˆœ์„œ
→ htmlํŒŒ์ผ ์ž‘์„ฑ
→ reset css ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑ
→ reset.css ํŒŒ์ผ์„ ์ „์ฒด style.css ํŒŒ์ผ์— import

 

๐ŸŸข HTML์— CSS ํŒŒ์ผ ์—ฐ๊ฒฐ
→ ์ €๋Š” ๋ณดํ†ต style.css ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด ์ ์šฉ๋˜๋Š” css ํŒŒ์ผ์„ ์—ฌ๊ธฐ์— ๋ชจ์•„ import ํ•ฉ๋‹ˆ๋‹ค!

<link rel="stylesheet" href="../common/css/style.css">

 

๐ŸŸข style.css ํŒŒ์ผ์— import ํ•˜๊ธฐ

@charset "UTF-8";
/* ์ €๋Š” ๋ณดํ†ต reset์ฝ”๋“œ๋ฅผ common.css์— ๋ชจ์•„์ค๋‹ˆ๋‹ค*/
@import url("common.css");

 

๐ŸŸข css ํŒŒ์ผ์— reset ์ฝ”๋“œ ์ž‘์„ฑํ•˜๊ธฐ

/* common.css file */

@charset "UTF-8";

/* reset */

*{margin:0;padding:0; font-family:'Noto Sans', 'Noto Sans Korean'; -webkit-text-size-adjust: none;  -moz-text-size-adjust: none;  -ms-text-size-adjust: none;}

html, body {width:100%; height:100%; margin:0; padding:0; font-family:'Noto Sans', 'Noto Sans Korean', 'Nanum Gothic', Nanum Gothic, '๋‚˜๋ˆ”๊ณ ๋”•', Dotum, '๋‹์›€', Gulim, '๊ตด๋ฆผ',sans-serif; -webkit-text-size-adjust: none;  -moz-text-size-adjust: none;  -ms-text-size-adjust: none; }

body{font-size:16px;  word-break:break-all;-ms-word-break:break-all; line-height:1.1;}
a, address, blockquote, br, fieldset, legend, label, form, input, select, textarea, button, table, th, td caption, cite, code, dl, dt, dd, h1, h2, h3, h4, h5, h6, p, div, iframe, ul, ol, li, hr, img{margin:0; padding:0;}
h1, h2, h3, h4, h5, h6 {font-size:16px; text-align:left;}
ul, ol, li {list-style:none;}
abbr,acronym {border:0;}
img{vertical-align:middle; border:none;}
img, fieldset, iframe{border:none;}
em, address{font-style:normal;}
textarea{overflow:auto;}
table{border-collapse:collapse; border-spacing:0;}
input, select, textarea{font-size:100%; vertical-align:middle;}
select{font-size: inherit; font-family: inherit; color: inherit;text-transform: none;vertical-align: middle; box-sizing:border-box; appearance: none; -webkit-appearance: none; -moz-appearance: none; -o-appearance: none;}
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 0;
    border: none;
    background: none;
}

/* hyper link */
a,
a:link,
a:visited{text-decoration:none;}
a:active,
a:hover{text-decoration:none;}

/* hidden content */
.skip{font-size: 1px; height: 1px; line-height: 1px; overflow: hidden; position: absolute; text-indent: 4px; white-space: nowrap; width: 1px;}

/* hr , legend , caption */
hr, legend, caption{clear:both; display:none; list-style:none; position:absolute; top:0; left:0; width:0; height:0; margin:0; padding:0; border:0; background:none; font-size:0px; line-height:0; visibility:hidden;}

/* clear */
.clear{*zoom:1;}
.clear:after{content:""; clear:both; display:block;}

/*hidden*/
.hidden {
	display : none;
}

/* flex */
.flex {
    display: flex;
}

@charset "UTF-8";

/* 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;
}
728x90
๋ฐ˜์‘ํ˜•