RESET.CSS

LUCY·2022년 4월 19일
0

CSS

목록 보기
4/5
post-thumbnail

스타일 초기화

💡 HTML 요소에 내장된 고유 CSS 속성을 초기화 시켜서 크로스브라우징을 구현할때 유용함 // 브라우저마다 기본적으로 제공하는 스타일값 이 있어 기본값으로 초기화 시켜주기 위해 설정

Reset CSS란 브라우저 간의 차이를 최대한 없애는 코드를 넣어서, 브라우저 요소들의 스타일이 “0”인 상태에서 디자인을 만들기 위해 사용하는 코드이다.

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

적용방법

@import "reset.css"; // 맨 위에 적어야 한다

.newbox
{
	padding: 5px;
}
<head>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/style.css">
</head>
// 다른 CSS와 함께 HTML 파일 안에서 불러와서 사용 가능하다.

0개의 댓글