CSS-클립

기술

클립 속성은 절대 위치 요소의 내용이 표시되지 않는 영역의 외측을 정의한다.

가능한 값

  • auto − 클리핑 영역은 배치 된 요소의 콘텐츠 영역과 동일합니다.

  • shape− 모양 설명자. CSS2에서 유효한 모양은 rect (오른쪽 상단 왼쪽 하단)입니다.

적용

블록 수준 및 대체 요소.

DOM 구문

object.style.clip = rect(top right bottom left);

다음은이 속성의 효과를 보여주는 예입니다.

<html>
   <head>
      <style type = "text/css">
         div {
            background: url(/https/isolution.pro/images/css.gif);
            clip:rect(10px, 155px, 145px, 10px);
            border:2px solid black;
            height:100px;
            width:150px;
            position:absolute;
            top:inherit;
            left:0px;
         }
      </style>
   </head>

   <body>
      <div>Example of clipping one image using css clip property</div>
   </body>
</html>

다음 결과가 생성됩니다-


Language