overflow-x:hidden; /*오버플로우 스크롤에서 가로 이동 스크롤을 삭제하는것*/
}
</style>
</head>
<body>
<divid="i1">This text is really long and the height of its container is only 100 pixels. Therefore, a scrollbar is added to help the reader to scroll the content. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem.</div>
</body>
</html>
< CSS 폰트 변경 >
1) 경로 지정
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<styletype="text/css">
@font-face{
font-family: myFont1;
/*src: url('./font/sansation_light.woff');*/
src:url('./font/gabia_bombaram.ttf'); /*폰트를 다운받은 후 파일의 경로를 지정해서 적용*/
}
#i1{
font-family: myFont1;
font-style:25px;
}
</style>
</head>
<body>
<divid="i1">Hello world</div>
</body>
</html>
<본문에 따라 커서의 모양이 바뀜>
<body>
<divstyle="cursor:default;">default</div>
<divstyle="cursor:auto;">auto</div>
<divstyle="cursor:crosshair";>crosshair</div>
<divstyle="cursor: e-resize;">e-resize</div>
</body>
* 커스텀 하여 목록 만들기
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<styletype="text/css">
ul.a{list-style-type:circle;} /*css타입으로 편집가능*/
ul.b{list-style-type:square;}
ol.a{list-style-type:upper-roman;}
ul.c{list-style-image:url('./images/purple.gif');} /* 이미지로 점 선택할 수 있음 */
</style>
</head>
<body>
<ulclass="a">
<li>사과</li>
<li>참외</li>
<li>수박</li>
<li>딸기</li>
</ul>
<ulclass="b">
<li>사과</li>
<li>참외</li>
<li>수박</li>
<li>딸기</li>
</ul>
<olclass="a">
<li>사과</li>
<li>참외</li>
<li>수박</li>
<li>딸기</li>
</ol>
<ulclass="c">
<li>사과</li>
<li>참외</li>
<li>수박</li>
<li>딸기</li>
</ul>
</body>
</html>
*본문 테두리 설정하기(round형으로)
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<style>
p.normal{
border:2pxsolidred;
padding:5px;
}
p.round1{
border:2pxsolidred;
border-radius:5px;
padding:5px;
}
p.round2{
border:2pxsolidred;
border-radius:8px;
padding:5px;
}
p.round3{
border:2pxsolidred;
border-radius:12px;
padding:5px;
}
</style>
</head>
<body>
<pclass="normal">Normal border</p>
<pclass="round1">Normal border</p>
<pclass="round2">Normal border</p>
<pclass="round3">Normal border</p>
</body>
</html>
*div내용 숨기기/ 영역 숨기기
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<style>
.div1{
width:300px;
height:100px;
border:1pxsolidblue;
/*영역이 없어짐
영역이 없어지면서 박스모델2가 위로 올라옴*/
/*display: none;
/*내용만 없어짐*/
visibility:hidden;
}
.div2{
width:300px;
height:100px;
border:1pxsolidred;
}
</style>
</head>
<body>
<divclass="div1">박스모델1</div><br/>
<divclass="div2">박스모델2</div>
</body>
</html>
*메뉴 만들기
- 커서가 올라가면 해당 박스의 배경색이 바뀜
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<styletype="text/css">
ul{ /*기본 바 배경색과 크기*/
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
background-color:#333;
}
li{ /*li들의 위치*/
float:left;
}
lia{ /*li a 태그의 글자 색과 id*/
display:block;
color:white;
text-align:center;
padding:14px16px;
text-decoration:none;
}
lia:hover{ /*마우스 커서가 올라가면 색이 변함*/
background-color:#111;
}
</style>
</head>
<body>
<ul>
<li><aclass="active"href="#home">Home</a></li>
<li><ahref="#news">News</a></li>
<li><ahref="#contact">Contact</a></li>
<li><ahref="#about">About</a></li>
</ul>
</body>
</html>
*단순 정보 나타낼 때 본문 표현법(사진+글 배치)
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<styletype="text/css">
img{ /*테이블과 같은 배치효과를 얻을 수 있다 */
width:170px;
height:170px;
margin-right:15px;
float:left;
/*margin-left: 15px;
float:right; */
}
</style>
</head>
<body>
<imgsrc="./images/pineapple.jpg"/>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Mauris ante ligula, facilisis sed ornare eu, lobortis in odio. Praesent convallis urna a lacus interdum ut hendrerit risus congue. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta. Cras ac leo purus. Mauris quis diam velit.
</body>
</html>
*div를 사용하여 레이아웃을 겹치게 구현하기
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<styletype="text/css">
div{
width:100px;
height:100px;
border:1pxsolidred; /*임의로 위치를 정하여 div의 레이아웃을 겹치게 만들 수 있다*/
}
#i1{
position:absolute;
top:0px;
left:0px;
background-color:red;
z-index:3; /*쌓이는 순서도 다르게 할 수 있다. 해당 코드는 3번째로 쌓이기 때문에 맨 위에 올라와 있는 것처럼 보이는 것임*/
}
#i2{
position:absolute;
top:50px;
left:50px;
background-color:green;
z-index:2;
}
#i3{
position:absolute;
top:100px;
left:100px;
background-color:blue;
z-index:1;
}
</style>
</head>
<body>
<divid="i1">Layer1</div>
<divid="i2">Layer2</div>
<divid="i3">Layer3</div>
</body>
</html>
*위와 같은 코드로 상대적 위치로 설정
<styletype="text/css">
div{
width:100px;
height:100px;
border:1pxsolidred; /*layer1에 따라서 배치가 된다(상대적 위치)*/
}
#i2{
position:relative;
top:50px;
left:50px;
background-color:green;
z-index:2;
}
#i3{
position:relative;
top:100px;
left:100px;
background-color:blue;
z-index:1;
}
</style>
######################### ex34, ex35 코드 이해 부족... 해당 코드 다시 살펴보기 ###########################