ex1-1
- 목표 border 속성을 다룰 수 있다.
- border-witdth
- border-radius
- border 원모양
<style>
.box{
border-width: thick;
border-style: dashed;
border-color: black;
border-radius: 50px;
}
.box2{
border-width: thick;
border-style: groove;
border-color: black;
border-radius: 20px 50px 10px 3px;
}
.box3{
border-width: 20px 5px 10px 2px;
border-style: dashed;
border-color: black;
border-radius: 20px;
}
.box4{
width: 100px;
height: 100px;
border-width: 2px;
border-style: dashed;
border-radius: 100px;
border-color: black;
text-align: center;
line-height: 100px;
background-color: bisque;
}
</style>
<body>
<div class="box">
<h1>Lorem ipsum dolor amet</h1>
</div>
<br>
<div class="box2">
<h1>Lorem ipsum dolor amet</h1>
</div>
<br>
<div class="box3">
<h1>Lorem ipsum dolor amet</h1>
</div>
<br>
<div class="box4">
test
</div>
</body>
결과

ex1-2
목표 - display 속성에 대한 이해
- display: none
- display: block
- disply: inline
- disply: inline-block
<style>
#box{
display: inline-block;
background-color: black;
color: white;
width: 300px;
height: 50px;
}
</style>
<body>
<span>더미 객체</span>
<div id="box">대상 객체</div>
<span>더미 객체</span>
</body>
결과

ex1-3
목표 - background 속성에 대한 이해
- background-image 배경 이미지 추가하기
- background-size: 배경 이미지 사이즈 변경
- background-repeat: 이미지 반복 제어
- background-attachment: scroll
- background-attachment: fixed
<style>
body{
background-image: url(img/BackgroundFront.png), url(img/BackgroundBack.png);
background-size: 100% 250px;
background-repeat: no-repeat;
background-attachment: scroll;
}
</style>
<body>
<span>더미 객체</span>
<div id="box">대상 객체</div>
<span>더미 객체</span>
</body>
결과

ex2-1
목표 box-shadow, line-height를 이해한다.
<style>
.font_big{
font-size: 2em;
}
.font_italic{
font-style: italic;
}
.font_bold{
font-weight: bold;
}
.font_center{
text-align: center;
}
.button{
width: 250px;
height: 250px;
background-color: #ff6a00;
border: 10px solid #ffffff;
border-radius: 250px;
box-shadow: 50px 5px 10px #a9a9a9;
}
.button > a{
display: block;
line-height: 250px;
}
</style>
<body>
<div class="button">
<a href="#" class="font_big font_italic font_bold font_center">Click</a>
</div>
</div>
</body>
결과

ex2-2
목표 - position: absolute에 대한 이해
- position: absolute
- left, top, right, bottom
- z-index
- overflow: hidden;
- overflow: scroll;
<style>
.box{
width: 100px;
height: 100px;
position: absolute;
}
.box:nth-child(1){
background-color: red;
left: 10px; top: 10px;
z-index: 100;
}.box:nth-child(2){
background-color: green;
left: 50px; top: 50px;
z-index: 300;
}.box:nth-child(3){
background-color: blue;
left: 90px; top: 90px;
z-index: 1000;
}
body > div{
width: 400px;
height: 100px;
border: 3px solid black;
position: absolute;
overflow: hidden;
}
</style>
<body>
<div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
</body>
결과

ex2-3
목표 - layout 정렬방법인 float에 대한 이해
- float: left, right
- clear: both
<style>
img {
float: left;
}
.box{
width: 100px; height: 100px;
background-color: royalblue;
margin: 10px; padding: 10px;
float: left;
}
.nobox{
clear: both;
width: 100px; height: 100px;
background-color: orangered;
margin: 10px; padding: 10px;
}
</style>
<body>
<img src="img/hanbit.jpg">
<p> [가로 거리]: 그림자의 수평 위치를 지정합니다.
-5px는 그림자를 왼쪽으로 5픽셀 이동시킵니다.</p>
<p> [세로 거리]: 그림자의 수직 위치를 지정합니다.
그림자를 위로 5픽셀 이동시킵니다. </p>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="nobox"></div>
<div class="nobox"></div>
</body>
결과

ex4-1
목표 float를 활용할 줄 안다.
<style>
.mom{
width: 500px; height: 400px;
background-color: red;
}
.first{
background-color: orangered;
width: 500px;
height: 100px;
overflow: hidden;
}
.second{
background-color: royalblue;
height: 200px;
overflow: hidden;
}
.second_one{
background-color: white;
width: 150px;
height: 200px;
float: left;
}
.son{
background-color: pink;
width: 150px;
height: 100px;
overflow: hidden;
}
.second_two{
background-color: aqua;
width: 350px;
height: 200px;
overflow: hidden;
}
.third{
background-color: purple;
height: 100px;
overflow: hidden;
}
</style>
<body>
<div class="mom">
<div class="first"><span>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span></div>
<div class="second">
<div class="second_one">
<div class="son"><span>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</span></div>
<div></div>
</div>
<div class="second_two"><span>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</span></div>
</div>
<div class="third"><span>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p></div>
</div>
</body>
결과
