<style>
.box5{
width: 100px;
height: 100px;
background: #0094ff;
margin: 100px;
}
/* ์๋ ๊ณก์ */
.box5{transition: transform 2s ease-in;}
.box5:hover{transform: scale(2) perspective(120px) rotateX(180deg);}
</style>
<body>
<div class="box5"></div>
</body>
<style>
#graph{
width: 610px;
border: 3px solid black;
}
.bar{
width: 10px;
height: 50px;
background-color: orange;
margin: 5px;
}
#graph:hover .bar{
width: 600px;
/* transition-property: width, background-color;
transition-duration: 5s, 5s; */
transition: all 5s ease;
}
/* ์๋ */
.bar:nth-child(1){
background-color: red;
transition-timing-function: linear;
}
.bar:nth-child(2){
background-color: blue;
transition-timing-function: ease;
}
.bar:nth-child(3){
background-color: green;
transition-timing-function: ease-in;
}
.bar:nth-child(4){
background-color: yellow;
transition-timing-function: ease-out;
}
.bar:nth-child(5){
background-color: pink;
transition-timing-function: ease-in-out;
}
</style>
<body>
<div id="graph">
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
</div>
</body>
<style>
div{
width: 100px;
height: 100px;
border: 1px solid black;
margin: 50px;
}
#box{
/* background-color: blue;
animation-name: chang-bg;
animation-duration: 3s;
animation-iteration-count: 3;
animation-direction: alternate;
animation-timing-function: ease-in-out; */
animation: chang-bg 3s 1s infinite alternate ease-in-out;
}
@keyframes chang-bg {
from{background-color: blue;}
50%{background-color: violet;}
to{
background-color: yellow;
border-radius: 50%;
}
}
</style>
animation
์ ๋๋ฉ์ด์
์ด๋ฆ | ์ง์ ์๊ฐ | ๋ฐ๋ณต ํ์ | ์ ๋๋ฉ์ด์
๋ฐฉํฅ | ์๋ ๊ณก์
<body>
<div id="box"></div>
</body>
<style>
.box1{
width: 400px;
height: 100px;
padding: 10px;
border: 1px solid black;
background-color: #ff6a00;
}
.box2{
width: 50%;
height: 100px;
padding: 10px;
border: 1px solid black;
background-color: #006eff;
}
</style>
width ๋จ์๋ฅผ px๋ฅผ ์ฐ๋์ง, %๋ฅผ ์ฐ๋์ง์ ๋ฐ๋ผ ๊ฒฐ๊ณผ๊ฐ ๋ค๋ฅด๊ฒ ๋ํ๋จ. %๋ ํ๋ฉด ๋น์จ์ ๋ฐ๋ฅธ ๋น์จ๋ก ๋ณ๊ฒฝ๋์ด ํํ. px์ ์์น ๊ณ ์ ์ผ๋ก ํํ.
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
inline
์ฝํ
์ธ ๋์ด ์ํ ์งํ. ์ฝํ
์ธ ์์ญ์ ์ ์.
block
์ฝํ
์ธ ๋์ด ์์ง ์งํ. ๋ฐ์คํํ๋ก ์ฝํ
์ธ ๊ฐ ์์น๋ ์์ญ ํ ์ค์ ์ฐจ์งํ๋ ์์ญ ์ ์.
inline-block
์ฝํ
์ธ ๋์ด ์ํ ์งํ.
<style>
div{
margin: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
img{width: 300px;}
.visible{visibility: visible;}
/* ํ๋ฉด์ ๋ณด์ด์ง ์๊ณ ๊ณต๊ฐ๋ ์ฐจ์งํ์ง ์์ */
.none{display: none; }
/* ๊ณต๊ฐ์ ์ฐจ์งํ์ง๋ง ๋ด์ฉ์ ์ ๋ณด์ฌ์ค */
.hidden{visibility: hidden;}
</style>
<body>
<div>
<img class="visible" src="./์ ์๋ ์๋ฃ/์ค์ต/de1.jpg">
<img class="none" src="./์ ์๋ ์๋ฃ/์ค์ต/de2.jpg">
<img class="visible" src="./์ ์๋ ์๋ฃ/์ค์ต/de3.jpg">
</div>
<div>
<img class="visible" src="./์ ์๋ ์๋ฃ/์ค์ต/de1.jpg">
<img class="hidden"src="./์ ์๋ ์๋ฃ/์ค์ต/de2.jpg">
<img class="visible" src="./์ ์๋ ์๋ฃ/์ค์ต/de3.jpg">
</div>
</body>
<style>
div {
width:200px;
height:100px;
display:inline-block;
margin:15px;
border-width:10px; /* 2. ํ
๋๋ฆฌ ๊ตต๊ธฐ : ์ฌ๋ฐฉ ๊ฐ์ ๊ฐ, ๋ค๋ฅธ ๊ฐ, ํค์๋(thin, medium, thick) */
border-top-color:aquamarine; /* 3. ์๊น: ์ฌ๋ฐฉ ๊ฐ์ ๊ฐ(border-color), ๋ค๋ฅธ ๊ฐ(top, right, bottom, left ),*/
/* 4. ์์ฑ ๋ฌถ์ด ํํ ๊ฐ๋ฅ, ์์ ์๊ด ์์ */
}
/* 1. ์ ํํ */
.box1 {border-style:solid;} /* ์ค์ */
.box2 {border-style:dotted;} /* ์ ์ */
.box3 {border-style:dashed;} /* ์ ์ผ๋ก ๋ ์ ์ */
.box4 {border-style: double;}
.box5 {border-style: groove;}
.box6 {border-style: inset;}
.box7 {border-style: outset;}
.box8 {border-style: ridge;}
</style>
<body>
<div class="box1">solid </div>
<div class="box2">dotted </div>
<div class="box3">dashed </div>
<div class="box4">double </div>
<div class="box5">groove </div>
<div class="box6">inset </div>
<div class="box7">outset </div>
<div class="box8">ridge </div>
</body>
<style>
div {
width: 300px; /* ๋๋น */
height: 200px; /* ๋์ด */
margin: 20px; /* ์์ญ๊ฐ ๋ง์ง */
display: inline-block; /* ๊ฐ๋ก๋ก ๋ฐฐ์น */
border:5px solid cadetblue; /* 2px์ง๋ฆฌ ๋นจ๊ฐ ์ค์ */
}
.round {/* ์ฌ๋ฐฉ ๋์ผ */
border-radius:20px; /* ๋ชจ์๋ฆฌ 20px ๋งํผ ๋ผ์ด๋ฉ */
}
.round-top{/* ์์ชฝ๋ง */
border-top-left-radius:20px;
border-top-right-radius:20px;
}
.round-four {/* ์ฌ๋ฐฉ ๋ค๋ฅด๊ฒ */
border-radius:70px 20px;
}
/* ๋ชจ์๋ฆฌ๋ฅผ ํ์์ฒ๋ผ */
.round1 {border-top-left-radius:100px 50px;} /* ์ผ์ชฝ ์ ๋ผ์ด๋ฉ */
.round2 {border-bottom-right-radius:50% 30%;}
</style>
<body>
<div class="round bg"></div>
<div class="round-top bg"></div>
<div class="round-four bg"></div>
<br>
<div class="round1"></div>
<div class="round2"></div>
</body>
<style>
* {
box-sizing:border-box;
}
div {
width:200px; /* ๋๋น */
height:100px; /* ๋์ด */
margin:30px; /* ๋ง์ง */
}
#box1 {
background:rgb(0, 77, 243);
}
#box2 {
background:rgb(255, 72, 0);
}
#box3 {
background:rgb(18, 219, 0);
}
</style>
margin-overlap
์์๋ฅผ ์ธ๋ก๋ก ๋ฐฐ์น์ ๋ง์ง๊ณผ ๋ง์ง์ด ๋ง๋๋ฉด ๋ง์ง ๊ฐ์ด ํฐ ์ชฝ์ผ๋ก ๊ฒน์ณ์ง๋ ๊ฒ
-> ์ฌ๋ฌ ์์๋ฅผ ์ธ๋ก๋ก ๋ฐฐ์นํ ๋ ๋ง์ง์ด ๋๋ฌด ์ปค์ง๋ ๊ฒ์ ๋ฐฉ์งํ๊ธฐ. ์ํ ๊ฒ ์, ์๋ ๋ง์ง์ ํฐ ๊ฐ์ผ๋ก ํฉ์ณ์ง๊ณ
์ค๋ฅธ์ชฝ ์ผ์ชฝ ๋ง์ง์ ๋ง๋๋ ์ค์ฒฉ๋์ง ์๋๋ค
<body>
<div id="box1"></div>
<div id="box2"></div>
<div id="box3"></div>
</body>
ํจ๋ฉ(padding)์ด๋ ์ฝํ ์ธ ์์ญ๊ณผ ํ ๋๋ฆฌ ์ฌ์ด์ ์ฌ๋ฐฑ.