기술
오버 플로우의 특성은 요소의 내용 영역을 오버 플로우 내용을 처리하는 방법을 결정합니다.
가능한 값
visible − 넘쳐나는 콘텐츠가 표시되어야합니다.
hidden − 넘쳐나는 콘텐츠가 표시되지 않아야합니다.
scroll − 넘쳐나는 콘텐츠는 표시되어서는 안되지만 사용자 에이전트는 숨겨진 콘텐츠에 접근 할 수있는 수단 (예 : 스크롤바 세트)을 제공해야합니다.
auto −이 값으로 인한 동작은 브라우저에 따라 다릅니다.
적용
모든 HTML 요소.
DOM 구문
object.style.overflow = "scroll";
예
다음은 예입니다.
<html>
<head>
<style type = "text/css">
.scroll {
display:block;
border: 1px solid red;
padding:5px;
margin-top:5px;
width:300px;
height:50px;
overflow:scroll;
}
.auto {
display:block;
border: 1px solid red;
padding:5px;
margin-top:5px;
width:300px;
height:50px;
overflow:auto;
}
</style>
</head>
<body>
<p>Example of scroll value:</p>
<div class = "scroll">
I am going to keep lot of content here just to show you how
scrollbars works if there is an overflow in an element box.
This provides your horizontal as well as vertical scrollbars.
</div>
<br />
<p>Example of auto value:</p>
<div class = "auto">
I am going to keep lot of content here just to show you how
scrollbars works if there is an overflow in an element box.
This provides your horizontal as well as vertical scrollbars.
</div>
</body>
</html>
이것은 다음 결과를 생성합니다-