HTML, CSS
(23)CSS_id선택자
빠스무
2023. 3. 29. 17:47
728x90
- CSS id선택자
- 사용하는 태그에 관한 문법 설명은 아래 링크로 가서 확인 가능하다.
- https://jm-rograming.tistory.com/54
(15)CSS_기본 문법
CSS(Cascading Style Sheets) 웹 페이지의 특정 요소 또는 그룹에 적용할 스타일 그룹을 지정하는 규칙을 정의하는 언어 ✔ 참고 MDN: https://developer.mozilla.org/ko/ MDN Web Docs The MDN Web Docs site provides information a
jm-rograming.tistory.com
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>id 선택자</title>
<style>
#container{
background-color: gold;
padding: 20px;
width:600px;
height: 300px;
text-align: center;
margin: 100px auto;
}
#header{
/*
배경색: deepskyblue
가로: 200px
세로: 200px
글자 -> 가운데 정렬
박스 -> 가운데 정렬
*/
background-color: deepskyblue;
width: 200px;
height: 200px;
text-align: center;
margin: 100px;
line-height: 200px;
}
</style>
</head>
<body>
<h2>id 선택자</h2>
<div id="container">div 첫번째 영역</div>
<div id="header">div 두번째 영역</div>
</body>
</html>