정렬 하는 법
.b1{
display: table;
width: 100%;
height: 100%;
}
.b2{
display: table-cell;
vertical-align: middle;
}
/* 들여쓰기*/
text-indent: 50px;
/* 글자자간, 사용은 안한다. */
letter-spacing: -2px;
/* 단어간 띄어쓰기 그러나, 사용안한다. */
word-spacing: -2px;
white-space: nowrap;
overflow: hidden;
/* ...좀 나오게 하는 것 다만, 한줄 그리고 텍스트가 넘쳤을 때 */
text-overflow: ellipsis;
출력결과
크기(가로축) 크기 (세로축) => 2px 2px Hello
크기 크기 색상
크기 크기 블러크기 색상
.e{
font-size: 50px;
text-shadow: 0px 0px 10px lime;
color: white;
height: 300px;
background-image: url('moun.png');
/*가로 세로 */
background-size: 100px 100px;
background-repeat: no-repeat;
background-position: center;
/* 가로,세로,블러,스프레드 색상 */
box-shadow: 0px 0px 4px 10px lime;
}
% --> 배경 이미지의 중간지점 위치를 비율로 지정, 단 0%를 잡더라도 이미지는 붙게하여 제공
px,외 다른 수치들 --> 중간점 위치를 해당 수치에 맞추어 지정.
top, bottom,center,left,right : 해당 지정 방향에 위치시킴
위치지정 없는 경우 relative와 동일
조상을 기준으로 절대적 위치 지정가능
z- index : 숫자 ; --> 0 ~ n 까지. 작을 수록 화면에 가깝다.,우선순위부여
cursor : 마우스 갖다대면 바뀌는 것
.e{
font-size: 50px;
text-shadow: 0px 0px 10px lime;
color: white;
height: 300px;
background-image: url('moun.png');
/*가로 세로 */
background-size: 100px 100px;
background-repeat: no-repeat;
background-position: center;
}
.f{
height: 100px;
background-image: linear-gradient(to bottom right, green, blue, purple);
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test08</title>
<style type="text/css">
.a {
/* 인라인 블록도 설정 가능 */
text-align: left;
background-color:red;
height: 100px;
line-height: 50px;
/* 들여쓰기*/
text-indent: 50px;
/* 글자자간, 사용은 안한다. */
letter-spacing: -2px;
/* 단어간 띄어쓰기 그러나, 사용안한다. */
word-spacing: -2px;
}
.b{
text-align: center;
background-color: orange;
height: 100px;
}
.b1{
display: table;
width: 100%;
height: 100%;
}
.b2{
display: table-cell;
vertical-align: middle;
}
.c{
text-align: right;
}
.d{
display: inline-block;
width: 80px;
height: 80px;
border: 1px solid #000000;
/* white-space: 여백 */
white-space: nowrap;
overflow: hidden;
/* ...좀 나오게 하는 것 다만, 한줄 그리고 텍스트가 넘쳤을 때 */
text-overflow: ellipsis;
/* 가로,세로,블러,스프레드 색상 */
box-shadow: 0px 0px 4px 10px lime;
}
.e{
font-size: 50px;
text-shadow: 0px 0px 10px lime;
color: white;
height: 300px;
background-image: url('moun.png');
/*가로 세로 */
background-size: 100px 100px;
background-repeat: no-repeat;
background-position: center;
}
.f{
height: 100px;
background-image: linear-gradient(to bottom right, green, blue, purple);
}
</style>
</head>
<body>
<div class="a">Hello 안녕<br/>Hi</div>
<div class="b">
<div class="b1">
<div class="b2">
Hello<br/>Hi
</div>
</div>
</div>
<div class="c">Hello</div>
<div class="d">가나다라마바사아자차카타파하</div>
<div class="e">Hungry!!</div>
<div class="f"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test09</title>
<style type="text/css">
body{
margin: 0px;
font-size: 0pt;
}
.a, .b, .c{
display: inline-block;
vertical-align: top;
width: 100px;
height: 100px;
}
.a{
background-color: orange;
}
.b{
background-color: purple;
position: absolute;
left: 50px;
top: 50px;
z-index: 100;
}
.c{
background-color: aqua;
position: absolute;
left: 100px;
top: 100px;
z-index: 50;
}
.p{
display: inline-block;
vertical-align: top;
width: 300px;
height: 300px;
background-color: red;
position: relative;
z-index: 300;
}
.popup{
display: inline-block;
width: 300px;
height: 300px;
background-color: #ffffff;
box-shadow: 0px 0px 1px 1px #444444;
position: absolute;
top: calc(50% - 150px); /* 높이의 반만큼 뺌 */
left: calc(50% - 150px); /* 너비의 반만큼 뺌 */
z-index: 300;
font-size: 16pt;
cursor: pointer;
}
.bg{
display: inline-block;
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
background-color: #000000;
z-index: 200;
opacity: 0.6; /* 0.0(투명) ~ 1.0(불투명) */
}
</style>
</head>
<body>
<div class="a"></div>
<div class="p">
<div class="b"></div>
<div class="c"></div>
</div>
<div class="bg"></div>
<div class="popup">팝업이다.</div>
</body>
</html>
사실 이틀만에 방대한 양을 배워서 ...기억이나 잘 활용할 자신은 없지만, 어쨋든 하다보면 방법을 알게될거다. 차근차근 하나 씩 해보면서 감을 찾아보자 다만, 포기만 하지말자 그리고 개발자도구 활용하자.