shape-image-threshold
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since â¨2020å¹´1æâ©.
* Some parts of this feature may have varying levels of support.
shape-image-threshold 㯠CSS ã®ããããã£ã§ã shape-outside ã®å¤ã«æå®ãããç»åã«ãã£ã¦ã·ã§ã¤ããæ½åºããããã«ä½¿ç¨ããã¢ã«ãã¡ãã£ãã«ã®ãããå¤ãè¨å®ãã¾ãã
試ãã¦ã¿ã¾ããã
shape-outside: linear-gradient(
50deg,
rgb(77, 26, 103),
transparent 80%,
transparent
);
shape-image-threshold: 0.2;
shape-outside: linear-gradient(
50deg,
rgb(77, 26, 103),
transparent 80%,
transparent
);
shape-image-threshold: 0.4;
shape-outside: linear-gradient(
50deg,
rgb(77, 26, 103),
transparent 80%,
transparent
);
shape-image-threshold: 0.6;
<section class="default-example" id="default-example">
<div class="example-container">
<div class="transition-all" id="example-element"></div>
We had agreed, my companion and I, that I should call for him at his house,
after dinner, not later than eleven oâclock. This athletic young Frenchman
belongs to a small set of Parisian sportsmen, who have taken up âballooningâ
as a pastime. After having exhausted all the sensations that are to be found
in ordinary sports, even those of âautomobilingâ at a breakneck speed, the
members of the âAéro Clubâ now seek in the air, where they indulge in all
kinds of daring feats, the nerve-racking excitement that they have ceased to
find on earth.
</div>
</section>
.example-container {
text-align: left;
padding: 20px;
}
#example-element {
float: left;
width: 150px;
height: 150px;
margin: 20px;
background-image: linear-gradient(
50deg,
rgb(77, 26, 103),
transparent 80%,
transparent
);
}
ã¢ã«ãã¡ã³ã³ãã¼ãã³ãã®å¤ããããå¤ããã大ãããã¯ã»ã«ã¯ãã¹ã¦ãå¢çãç¹å®ããããã®ã·ã§ã¤ãã®ä¸é¨ã¨ã¿ãªããã¾ããä¾ãã°ã 0.5 ã®å¤ã¯ä¸éé度ã 50% ããã大ãããã¯ã»ã«ããã¹ã¦å«ããå³å½¢ã«ãªãã¨ããæå³ã§ãã
æ§æ
/* <number> å¤ */
shape-image-threshold: 0.7;
/* ã°ãã¼ãã«å¤ */
shape-image-threshold: inherit;
shape-image-threshold: initial;
shape-image-threshold: revert;
shape-image-threshold: unset;
å¤
<alpha-value>-
ç»åããã·ã§ã¤ããæ½åºããããã«ä½¿ç¨ããããããå¤ãè¨å®ãã¾ããã·ã§ã¤ãã¯ã¢ã«ãã¡å¤ããããå¤ãã大ãããã¯ã»ã«ã«ãã£ã¦å®ç¾©ããã¾ãã 0.0 (å®å ¨ã«éé) ãã 1.0 (å®å ¨ã«ä¸éé) ã®ç¯å²ãå¤ããå¤ã¯ããã®ç¯å²ã«åãããã¾ãã
å ¬å¼å®ç¾©
形弿æ³
shape-image-threshold =
<opacity-value>
<opacity-value> =
<number> |
<percentage>
ä¾
>ã°ã©ãã¼ã·ã§ã³ã¸ã®ããã¹ãã®é ç½®
ãã®ä¾ã§ã¯ãã°ã©ãã¼ã·ã§ã³ã®èæ¯ç»åãæã¤ <div> ãããã¯ã使ãã¾ããã°ã©ãã¼ã·ã§ã³ã¯ shape-outside ã使ç¨ã㦠CSS ã·ã§ã¤ãã¨ãã¦ç¢ºç«ããã¦ããã®ã§ãã°ã©ãã¼ã·ã§ã³ã®ä¸ã®ãã¯ã»ã«ã®ãã¡ 20% ããã大ããä¸éé度 (ã¤ã¾ããã¢ã«ãã¡ã³ã³ãã¼ãã³ãã 0.2 ããã大ãããã¯ã»ã«) ã¯ã·ã§ã¤ãã®ä¸é¨ã¨ã¿ãªããã¾ãã
HTML
<div id="gradient-shape"></div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel at commodi
voluptates enim, distinctio officia. Saepe optio accusamus doloribus sint
facilis itaque ab nulla, dolor molestiae assumenda cum sit placeat adipisci,
libero quae nihil porro debitis laboriosam inventore animi impedit nostrum
nesciunt quisquam expedita! Dolores consectetur iure atque a mollitia dicta
repudiandae illum exercitationem aliquam repellendus ipsum porro modi, id nemo
eligendi, architecto ratione quibusdam iusto nisi soluta? Totam inventore ea
eum sed velit et eligendi suscipit accusamus iusto dolore, at provident eius
alias maxime pariatur non deleniti ipsum sequi rem eveniet laboriosam magni
expedita?
</p>
CSS
#gradient-shape {
width: 150px;
height: 150px;
float: left;
background-image: linear-gradient(30deg, black, transparent 80%, transparent);
shape-outside: linear-gradient(30deg, black, transparent 80%, transparent);
shape-image-threshold: 0.2;
}
ã·ã§ã¤ãã¯ç»åãã¡ã¤ã«ã§ã¯ãªããç·å½¢ã°ã©ãã¼ã·ã§ã³ã® background-image ã使ç¨ãã¦å®ç¾©ããã¦ãã¾ããåãã°ã©ãã¼ã·ã§ã³ãã shape-outside ããããã£ã使ç¨ãã¦ãæµ®åé åãè¨å®ããããã«ã·ã§ã¤ããåå¾ãããç»åã¨ãã¦ã使ç¨ããã¾ãã
ã·ã§ã¤ãã®é¨åã¨ãã¦æ±ãã°ã©ãã¼ã·ã§ã³å
ã®ãã¯ã»ã«ã¯ 20% ã®ä¸éé度ããããå¤ãªã®ã§ã shape-image-threadhold ã®å¤ã 0.2 ã«ãã¦ä½¿ç¨ãã¦ä½æãã¦ãã¾ãã
çµæ
仿§æ¸
| Specification |
|---|
| CSS Shapes Module Level 1 > # shape-image-threshold-property > |