[수업 목표]
받아서 -> 그려주는
것<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>스파르타코딩클럽 | HTML 기초</title>
</head>
<body>
<!-- 구역을 나누는 태그들 -->
<div>나는 구역을 나누죠</div>
<p>나는 문단이에요</p>
<ul>
<li>bullet point!1</li>
<li>bullet point!2</li>
</ul>
<!-- 구역 내 콘텐츠 태그들 -->
<h1>
h1은 제목을 나타내는 태그입니다. 페이지마다 하나씩 꼭 써주는 게 좋아요.
그래야 구글 검색이 잘 되거든요.
</h1>
<h2>h2는 소제목입니다.</h2>
<h3>h3~h6도 각자의 역할이 있죠. 비중은 작지만..</h3>
<hr />
a 태그입니다: <a href="http://google.com/" target="_blank">하이퍼링크</a>
<hr />
img 태그입니다:
<img
src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"
/>
<hr />
input 태그입니다: <input type="text" />
<hr />
button 태그입니다: <button>버튼입니다</button>
<hr />
textarea 태그입니다: <textarea></textarea>
</body>
</html>
정렬 (mac - cmd + k + f / window - ctrl + k + f)
< head > ~ </ head > 안에 < style > ~ </ style > 로 공간을 만들어 작성
h1 {
color: red;
}
.test {
color: green;
font-size: 50px;
}
실행 (mac - option + b / window - alt + b)
<div class="box">
<div>첫 번째 구역</div>
<div>두 번째 구역</div>
</div>
.box {
background-color: green;
width: 800px;
height: 800px;
color: white;
}
.first {
background-color: red;
width: 300px;
height: 300px;
}
.second {
background-color: blue;
width: 400px;
height: 400px;
}
display: flex
& 간격 margin
.box {
background-color: green;
color: white;
width: 800px;
height: 800px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.first {
background-color: red;
width: 300px;
height: 300px;
margin-bottom: 20px;
}
.second {
background-color: blue;
width: 400px;
height: 400px;
}
배경 div 생성
.background {
background-color: green;
width: 400px;
height: 800px;
}
<div class="background"></div>
.background {
background-color: green;
width: 100vw;
height: 100vh;
max-width: 450px;
background-image: url("https://2022-01-newyear.s3.ap-northeast-2.amazonaws.com/bg_default.png");
background-position: center;
background-size: cover;
margin: auto;
}
body,
h1,
p {
margin: 0;
padding: 0;
}
display: flex
<div class="background">
<div class="title">
<h1>덕담 하나 주면 안 잡아먹지!</h1>
<p>
다영 님이 받은 덕담 : <span>2개</span>
</p>
</div>
</div>
.title {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-top: 5vh;
color: #3f3732;
}
.title > h1 {
font-size: 22px;
background-color: white;
padding: 8px 16px;
border-radius: 16px;
margin-bottom: 16px;
}
.title > p {
font-size: 18px;
}
.title > p > span {
font-size: 22px;
}
@font-face {
font-family: "Cafe24Ssurround";
src: url("https://2022-01-newyear.s3.ap-northeast-2.amazonaws.com/Cafe24Ssurround.woff")
format("woff");
}
* {
font-family: "Cafe24Ssurround";
}
.btn {
width: 300px;
height: 50px;
background-color: #3f3732;
color: white;
font-size: 18px;
border-radius: 10px;
cursor: pointer;
}
.btn {
width: 300px;
height: 50px;
background-color: #3f3732;
color: white;
font-size: 18px;
border-radius: 10px;
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.btn {
width: 300px;
height: 50px;
background-color: #3f3732;
color: white;
font-size: 18px;
border-radius: 10px;
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: fixed;
bottom: 16px;
left: calc(50% - 150px);
}
.box > img {
width: 70px;
}
...
<div class="box">
<img src="https://2022-01-newyear.s3.ap-northeast-2.amazonaws.com/object3.png">
</div>
.box > img {
width: 70px;
position: absolute;
left: 50%;
bottom: 50%;
}
<img
onclick="alert('새해복!')"
src="https://2022-01-newyear.s3.ap-northeast-2.amazonaws.com/object3.png"
/>
<script src=" "></script>
<script>
let mycode = ' ';
</script>
og 태그
<meta property="og:title" content="ㅇㅇ 님의 덕담 페이지"/>
<meta property="og:description" content="덕담 한마디 남겨주세요!"/>
<meta property="og:image" content="https://2022-01-newyear.s3.ap-northeast-2.amazonaws.com/ogimage.png"/>
og:image
og:title
og:description
을 미리 세팅해두면 공유 시 원하는 형태로 보여짐