수업목표
1.Elements
패널을 통해 웹 페이지 구성과 구성 요소들의 스타일을 확인할 수 있다.
2.Console
패널을 통해 자바스크립트 코드를 브라우저에서 즉시 실행할 수 있다.
3.Network
패널을 통해 네트워크 상으로 주고 받는 데이터를 확인할 수 있다.
4.Application
패널을 통해 브라우저의 저장소에 담긴 데이터를 확인할 수 있다.
📚 개발자 도구가 뭐야?
1. Elements panel
✅ Elements 패널의 기능?
✅ 해당페이지는 몇개의 세션?
✅ Instagram 피드의 가로 길이는?
✅ Styles 부분의 순서가 의미하는 것은?
CSS Specificity
- inline style > id > class > tag🤔 inline style이 왜 가장 구체적일까? 생각을 하는 과정에서 inline이라는 단어에서 Position과 관련된 것인가?하는 생각밖에 들지 않았다. 그래서 팀원들과 대화를 나누며 자료도 찾아보았고 'CSS 스타일 적용 방법 3가지'에 대해 알 수 있었다.
<body>
<p style="font-size:25pt;color:pink;">난 핑크야!</p>
</body>
코드를 보자!
<html>
<head>
<meta charset="utf-8">
<title>CSS</title>
<link rel="stylesheet" href="extstyle.css">
<style>
body { font-size:20pt; }
div {font-size:60px;color:purple;}
p {font-size:18pt; font-weight: bold; }
a { font-size:40pt;color:green; }
</style>
</head>
<body>
<h2>Cascading Style Sheet</h2>
<p>나는 스타일시트의 속성을 그대로 따른다.</p>
<p style="font-style:italic;">나는 기울임체로 표시된다.</p>
<p style="font-weight:bold;color:red">나는 빨간색 굵은 글꼴을 사용한다.</p>
<div>디브디브딥
<img src="대만사진.png" alt="대만폭포사진" width="300px">
</div>
<h1>속성은 위에서부터 아래로 상속된다.</h1>
<h3>폭포처럼 말이야!</h3>
<a href="">나는 링크야!</a>
</body>
</html>
<Style>
태그를 이용해 별도로 스타일을 정의.#
기호 사용.
기호 사용<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>CSS</title>
</head>
<style>
.test {
color:steelblue;
font-size: 30px;
}
.test2{
font-weight: bold;
}
</style>
<body>
<div class="test">나는 Internal Style Sheet</div>
<div class="test2">style태그를 사용하지.</div>
</body>
<link>
태그로 불러와 스타일을 적용.<link>
태그 이용해 외부 CSS파일 불러옴.rel
속성: 현재 문서와의 관계.type
속성: CSS문서 타입. HMTL5 경우에는 생략 가능.href
속성: CSS 파일 주소.<!DOCTYPE html>
<html lang="en">
<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>CSS</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<div class="test">나는 External Style Sheet</div>
<div class="test2"> link 태그로 불러오지</div>
</body>
</html>
body{
background-color: cadetblue;
}
.test {
color: cornsilk;
font-size: 20px;
}
.test2{
font-size: 40px;
font-style: inherit;
}
✅user agent stylesheet
란?
reset.css
혹은 normalize.css
파일에서 기본 스타일 값을 모두 초기화 시키고 작업 시작. >>> 브라우저의 종류에 상관 없이 동일한 화면 출력 가능