-
21.09.07. 1-5~6강 (class="명찰", 배경화면 3총사, 여백, 중첩)일기 2021. 9. 7. 18:01
[class="명찰"]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>로그인페이지</title>
<style>
.mytitle {
}
</style>
</head>
<body>
<h1 class="mytitle">로그인 페이지</h1>
<p>ID: <input type="text"/></p>
<p>PW: <input type="text"/></p>
<button>로그인하기</button>
</body>
</html>h1 태그에 class="123" 를 달아주면 녀석을 지명하는 게 된다. 명찰을 달아주는 것.
그리고 title 태그 밑으로 <style>.123{ }</style>태그를 넣어주면 지명한 녀석을 꾸밀 준비가 된 거다.
{ } 안에 꾸미고 싶은 명령을 넣는 것.
- color: red;
- font-size: 40px;
[배경화면 3총사]
background-image: url("");
background-size: cover;
background-position: center;[여백]
*내부
padding-top: 내부 위쪽
<ex> padding-top: 20px;
*외부
margin: 상 우 하 좌 (머리부터 시계방향)
<ex> margin: 20px 0px 0px 30px;
*가운데 정렬
- 내 양쪽 여백이 동등하게 최대라는 뜻
margin: auto;
- 글: 박스로 바꿔준 다음 마진오토 넣기
display: block;
[중첩]
class는 중첩 기능이 있다. (명찰 두개)
class="A B"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>로그인페이지</title>
<style>
.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: 270px;
margin: auto;
}
.mybtn {
width: 100px;
margin: auto;
display: block;
}
.myID {
margin-left: 35px;
}
.myPW {
margin-left: 26px;
}
</style>
</head>
<body>
<div class="wrap">
<div class="mytitle">
<h1>로그인 페이지</h1>
<h5>아이디, 패스워드를 입력해주세요</h5>
</div>
<p class="myID">ID: <input type="text"/></p>
<p class="myPW">PW: <input type="text"/></p>
<button class="mybtn">로그인하기</button>
</div>
</body>
</html>'일기' 카테고리의 다른 글
21.09.09. 2-1강 (Javascript 복습, count) (0) 2021.09.09 21.09.08. 1-12~15강 (Javascript) (0) 2021.09.08 21.09.07~08. 1-8~11강 (부트스트랩, w3schools, mdn) (0) 2021.09.07 21.09.07. 1-7강 (폰트, 주석, CSS 나누기) (0) 2021.09.07 21.09.07. 1-4강 (첫 시작, 페이지 만들기) (0) 2021.09.07