Javascript: HTML - id class

HS·2021년 2월 11일
0

Javascript

목록 보기
3/3
<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
#rightSide {
	font-size: 1em;
	color: #00ffff;
}

aside.aside01 {
	font-size: 2em;
	color: #00ff00;
}

section.section01 {
	font-size: 2em;
	color: #ff0000;
}

section.section02 {
	font-size: 1em;
	color: #999999;
}
</style>

</head>
<body>
	<div id="rightSide">
		div_rightSide
		<aside class="aside01">
			<section class="section01">section01</section>
			<nav class="nav01">nav01</nav>
			<section class="section02">
				<article>
					<p>id와 class모두 문서전체에서 global attributes를 갖는다.</p>
					<p>id는 페이지마다 서로 다른 이름으로 유니크하게 명시</p>
					<p>class는 페이지에서 부분적으로 필요에 따라 사용</p>
					<p>classHTML5getElementByClassName()메소드로 활용됨.</p>
				</article>
			</section>
		</aside>
	</div>


</body>
</html>

출력물

0개의 댓글