꾸민다...꾸민다...!
<h1 style="color:red; background-color:yellow">Hello Design</h1>
<style>
h2{
color:blue;
}
</style>
01.basic.css 파일 생성
@charset "UTF-8";
h3{
color:green;
}
link 태그로 css 파일을 html파일과 연결
<link rel="stylesheet" type="text/css" href="01.basic.css">
<style>
h1{
color:blue;
}
h1[id=test]{
/* background-color: yellow; */
}
[id=test]{
/* background-color: yellow; */
}
#test{
background-color: yellow;
}
[class=a]{
/* text-decoration: underline; */
}
.a{
text-decoration: underline;
}
.b{
border: 1px solid black;
}
</style>
</head>
<body>
<h1>Hello CSS</h1>
<h1 id="test">Hello CSS</h1>
<h1 class="a">Hello CSS</h1>
<h1 class="a b">Hello CSS</h1>
<h1 class="b">Hello CSS</h1>
</body>
</html>
보이는 태그 뿐 아니라 자리를 잡기 위한 영역 설정에 사용
일관된 디자인 가능
정렬: 디자인을 먼저 만들고 태그 만들기
.container-300 { width:300px; margin:0 auto; }
.container-350 { width:350px; margin:0 auto; }
.container-400 { width:400px; margin:0 auto; }
...
.row {margin: 10px 0px;}
.w-100 {width:100%;}
<div class="container-300 center">
<div class="row center">
<h1>로그인</h1>
</div>
<div class="row">
<input class="w-100" type="text" name="memberId" placeholder="아이디">
</div>
<div class="row">
<input class="w-100" type="password" name="memberPw" placeholder="비밀번호">
</div>
<div class="row">
<button class="w-100" type="submit">로그인</button>
</div>
<div class="row">
<a href="#">비밀번호를 잊으셨나요?</a>
</div>
</div>