Css-clip
提供:Dev Guides
CSS-クリップ
説明
_clip_プロパティは、絶対に配置された要素のコンテンツが表示されない領域を定義します。
可能な値
- auto -クリッピング領域は、配置された要素のコンテンツ領域に相当します。
- shape -形状記述子。 CSS2の時点で、有効な形状はrect(top right bottom left)のみです。
に適用されます
ブロックレベルおよび置換された要素。
DOM構文
object.style.clip = rect(top right bottom left);
例
これは、このプロパティの効果を示す例です-
<html>
<head>
<style type = "text/css">
div {
background: url(/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>
それは次の結果を生成します-