html
1.
<style>
h1{
color: red;
}
</style>
2.
<h1 style="background: pink;">Hello World</h1>
3.
<link rel="stylesheet" type="text/css" href="style.css">
css
h1 {
font-size: 80px;
}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">
html
<header> (부모)
<h1>header h1</h1> (자식1)
<p>header p</p> (자식2)
<a href="#">네이버</a> (자식3)
</header>
<footer> (부모)
<h1>footer h1</h1> (자식1)
<p>footer p1</p> (자식2)
</footer>
css
header{
color: red;
}
h1{
color: pink;
}
header p{
color: green;
}
header h1,
footer h1 {
color: purple;
html
-1-
<h1>Hello World</h1>
-2-
<h2 id="test1">Nice to meet you</h2>
-3-
<h3 class="test2">Welcome</h3>
-4-
<input id="test3" type="text" placeholder="이름">
<input type="password" placeholder="비밀번호">
css
-1-
h1 {
color: red;
}
-2-
#test1 {
color: blue;
}
-3-
.test2 {
color: green;
}
-4-
#test3 {
border: solid 10px red;
}
input[type="password"] {
border: solid 10px blue;
}
html
<h2 id="color-1 font-style-1">ID 선택자</h2>
<h3 class="bg-1 font-size-1">Class 선택자</h3>
<p class="bg-1">Welcome</p>
<h4 id=color-3>ID 선택자</h4>
<h5 id="color-2">ID 선택자</h5>
<h6 id="color-2">ID 선택자</h6>
css
.bg-1 {
background-color: red;
}
.font-size-1 {
font-size: 50px;
}
#color-1 {
color: red;
}
#font-style-1 {
font-style: italic;
}
#color-2 {
color: blue;
}
#color-3 {
color: purple;
}
html
<header id="intro">
<div class="container">
<h2>header h2</h2>
<p>header p</p>
</div>
</header>
<p>Out P</p>
css
#intro h2 {
color: red;
}
#intro .container p {
color: blue;
}
html
<h1 style="color : gray;" id="color-2" class="color-1">Hello World</h1>
css
#color-2 {
color : pink;
}
.color-1 {
color : green;
}
h1 {
color: red;
}
h1 {
color: blue;
}
html
<header id="intro">
<div class="container">
<h1>header h1</h1>
</div>
</header>
css
#intro .container h1 {
color: pink;
}
#intro div h1 {
color: green;
}
#intro h1 {
color: blue;
}
header h1 {
color: red;
}
html
<div>
<h1>Nice</h1>
<ul>
<li>메뉴1</li>
<li>메뉴2</li>
</ul>
</div>
<a href="#">네이버</a>
css
div {
width: 100%;
height: 300px;
min-width: 600px;
max-width: 800px;
border: solid 10px red;
border-radius: 50px;
background-color: yellow;
}
h1 {
color: rgb(123, 111, 21);
font-size: 80px;
font-style: initial;
font-family: 'Noto Sans KR', sans-serif;
font-weight: 100;
text-decoration: line-through;
text-align: right;
background-color: pink;
opacity: 0.5;
}
a {
text-decoration: none;
}
ul {
list-style: none;
}
html
<div id="bg"></div>
<img src="icon.png" width="100px" height="50px" alt="네이버 로고">
css
#bg {
width: 256px;
height: 256px;
background-color: yellow;
background-image: url(icon.png);
background-repeat: no-repeat;
background-position: right top;
}
갑자기 주석처리로 오류가 발생해서 코드가 먹히지 않는 경우가 발생해 당황했다.
일단 새로운 파일을 작성해서 강의를 따라갔고 설명처럼 적어놓은 주석들은 다 다른곳으로 이전할 생각이다.
어차피 공부용으로 달아놓은 주석들이고 코드를 깔끔하게 하는 습관도 들인다면 적절한 주석만 다는것이 옳다고 생각해서이다.
일단 개발자노트에 덕지덕지 코드를 붙이고 사진을 붙이는 방식은 내가 이 개발자노트를 다시볼때 가독성부분에서 굉장히 떨어지는것 같다.
내일부터는 새로운 방식으로 배운 내용이 있으면 거기서 사용하는 간결한 코드 그리고 작업내용 방식으로 깔끔하게 정리해봐야겠다.