Web Page 를 구성하는 가장 기본으로, Web page의 문단, 제목 등을 정의한다.
아래와 같은 구조로 이루어진다.
<html lang="en">
<head>
<meta charset="UTF-8">
<title>로그인페이지</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https: //fonts.googleapis.com/css2? family= Nanum +Pen+Script & display=swap" rel="stylesheet">
</head>
<body>
<div class="wrap">
<div class="mytitle">
<h1>로그인 페이지</h1>
<h5>아이디, 패스워드를 입력해주세요</h5>
</div>
<p>ID: <input type="text"/></p>
<p>PW: <input type="text"/></p>
<button class="mybtn blue-font"> 로그인하기</button>
</div>
</body>
</html>
스타일을 정의할 때 쓰이며 HTML 과 함께 쓰인다.
아래와 같이 Style 태그 아래 내용이 정의된다.
<style>
* {
/*font-family: 'jua', sans-serif;*/
}
.mytitle {
background-color: green;
width: 300px;
height: 200px;
color: white;
text-align: center;
background-image: url("https://www.ancient-origins.net/sites/default/files/field/image/Agesilaus-II-cover.jpg");
background-size: cover;
background-position: center;
border-radius: 10px;
padding-top: 20px;
}
.wrap {
width: 300px;
margin: auto;
}
.mybtn{
width: 100px;
margin: auto;
display: block;
}
.blue-font{
color : blue;
font-size: 16px;
}
</style>
HTML, CSS 와 함께 쓰이며 Code를 통해 컨텐츠를 동적으로 바꾸어준다.
예시는 아래와 같다.
<script>
let count = 1;
function hey(){
if (count % 2 == 0) {
alert('짝수입니다!')
} else {
alert('홀수입니다!')
}
count += 1;
}
</script>