clip
Deprecated
Avoid using this feature in new projects.
The CSS Masking specification deprecated the clip property.
This feature may be a candidate for removal from web standards or browsers. >
Consider using the following features instead: clip-path. >
è¦å:
使è
ã¯ã代ããã« clip-path ããããã£ã使ç¨ãããã¨ããå§ããã¾ãã
clip 㯠CSS ã®ããããã£ã§ãè¦ç´ ã®ã©ã®é¨åãå¯è¦ã§ããããå®ç¾©ãã¾ãã clip ããããã£ã¯çµ¶å¯¾é
ç½®ãããè¦ç´ ãã¤ã¾ã position:absolute ã¾ã㯠position:fixed ãæã¤è¦ç´ ã ãã«é©ç¨ããã¾ãã
æ§æ
/* ãã¼ã¯ã¼ãå¤ */
clip: auto;
/* <shape> å¤ */
clip: rect(1px, 10em, 3rem, 2ch);
/* ã°ãã¼ãã«å¤ */
clip: inherit;
clip: initial;
clip: revert;
clip: revert-layer;
clip: unset;
å¤
rect()-
rect()颿°ã使ç¨ãã¦ãrect(<top>, <right>, <bottom>, <left>)ã®å½¢ã§å®ç¾©ãããé·æ¹å½¢ã<top>ã¨<bottom>ã¯ãããã¯ã¹å¢çã®ä¸è¾ºããã®ãªãã»ããã表ãã¾ãã<right>ã¨<left>ã¯ãããã¯ã¹å¢çã®å·¦è¾ºããã®ãªãã»ããã表ãã¾ãããããããã¯ã¹ã®ä¸èº«ã¨ãªãã¾ãã<top>ã<right>ã<bottom>ã<left>ã®å¤ã¯<length>ã¾ãã¯autoã®ããããã§ããautoãæå®ãããã¨ããã®è¾ºã®å¢çç·ã®å å´ã§åãåããã¾ãã
ã¡ã¢:
éæ¨å¥¨ã® clip ããããã£ã§ä½¿ç¨ããã <shape> 颿°ã® rect() ã¯ã CSS ã§ <basic-shape> ãå®ç¾©ããããã«ä½¿ç¨ãã CSS ã® rect() 颿°ã¨ã¯ç°ãªãã¾ãã
auto-
è¦ç´ ã¯ã¯ãªããããã¾ããï¼æ¢å®å¤ï¼ãããã¯ã¹å¢çã§åãåã
rect(auto, auto, auto, auto)ã¨ã¯ã¾ã£ããç°ãªããã¨ã«æ³¨æãã¦ãã ããã
å ¬å¼å®ç¾©
| åæå¤ | auto |
|---|---|
| é©ç¨å¯¾è±¡ | 絶対ä½ç½®æå®ãããè¦ç´ |
| ç¶æ¿ | ãªã |
| è¨ç®å¤ | auto ãæå®ããã¦ããã° autoããã以å¤ã¯ 4 ã¤ã®å¤ãã¨ããªãç©å½¢ãç©å½¢ã®å ´åãåå¤ã¯ auto ãæå®ããã¦ããã° autoããã以å¤ã§ã¯é·ãã®è¨ç®å¤ |
| ã¢ãã¡ã¼ã·ã§ã³ã®ç¨®é¡ | rectangle |
形弿æ³
clip =
<rect()> |
auto
<rect()> =
rect( <top> , <right> , <bottom> , <left> )
ä¾
>ç»åã®ã¯ãªãã
<p class="dotted-border">
<img src="macarons.png" alt="Original graphic" />
<img id="top-left" src="macarons.png" alt="Graphic clipped to upper left" />
<img id="middle" src="macarons.png" alt="Graphic clipped towards middle" />
<img
id="bottom-right"
src="macarons.png"
alt="Graphic clipped to bottom right" />
</p>
.dotted-border {
border: dotted;
position: relative;
width: 390px;
height: 400px;
}
#top-left,
#middle,
#bottom-right {
position: absolute;
top: 0;
}
#top-left {
left: 400px;
clip: rect(0, 130px, 90px, 0);
}
#middle {
left: 270px;
clip: rect(100px, 260px, 190px, 130px);
}
#bottom-right {
left: 140px;
clip: rect(200px, 390px, 290px, 260px);
}
仿§æ¸
| 仿§æ¸ |
|---|
| CSS Masking Module Level 1 > # propdef-clip > |