퍼블리싱/html, css, javascript

CSS 초기화 리셋 코드 공유 (+재설정 이유)

연지쁨 2023. 11. 6. 09:53
반응형

 

 

스타일시트의 재설정을 하는 이유

기본 줄 높이, 여백, 글꼴, 사이즈 등과 같은 브라우저 불일치를 줄이는 역할을 합니다.

아래 제공된 CSS스타일은 매우 일반적인 CSS 소스입니다.

현재 요소에는 기본 색상이나 배경이 없습니다.

특정 재설정 기준과 일치하도록 조정, 편집, 확장 및 조정해야 합니다. 페이지, 링크 등에 대해 원하는 색상을 입력하세요!

 

 

 

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

 

 

 

출처

 

 

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

 

반응형