테스트 사이트 - 개발 중인 베타 버전입니다

CSS Overflow auto

· 8년 전 · 1878

CSS Overflow auto

 

 

 

auto값과 비슷 scroll필요한 경우에만 스크롤 막대를 추가 :

 

레이아웃을보다 잘 제어하고 싶을 때 overflow 속성을 사용할 수 있습니다. overflow 속성은 내용이 요소의 상자를 오버플로하면 어떻게되는지 지정합니다.

 

div {

    overflow: auto;

}

 

<!DOCTYPE html>

<html>

<head>

<style>

div {

    background-color: #eee;

    width: 200px;

    height: 50px;

    border: 1px dotted black;

    overflow: auto;

}

</style>

</head>

<body>

 

<h2>CSS Overflow</h2>

<p>The auto value is similar to scroll, only it add scrollbars when necessary:</p>

 

<div>You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.</div>

 

</body>

</html>


댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
3168
3167
3166
3165
3164
3163
3162
3161
3160
3159
3158
3157
3156
3155
3154
3153
3152
3151
3150
3149
3148
3147
3146
3145
3144
3143
3142
3136
3135
3134