浮動体を避ける区画を定義。
名前 | shape-outside
|
---|---|
値 | none | [<basic-shape> || <shape-box>] | <image> |
初期値 | none |
適用対象 | 浮動体 |
継承 | されない |
百分率 | 受容しない |
算出値 | 指定されたキーワード/[基本図形の算出値に従う <basic-shape> と 0 ~ 1 個の<shape-box> 値]/算出 <image> |
正準的順序 | 文法に従う |
アニメーション型 | <basic-shape> に対しては 基本図形の補間に従う。他の値に対しては離散的。 |
none
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg, #808, #fff); shape-outside:none; float:left; padding:10px; ">1</DIV>あああああああああああああああああああああああああああああああああああああああああ </DIV>
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg, #808, #fff); shape-outside:inset(20px round 30px) padding-box; float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああああああああああああああああああああああああ </DIV>
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg, #808, #fff); shape-outside:linear-gradient(45deg, #808f, #fff0); shape-image-threshold:0.3; float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>shape-image-thresholdの指定が必要
図形は、margin-box、border-box、padding-box、content-box いずれかに基づいて、border-radius による曲げも含め、対応するボックスを利用して算出される ─ background-clip [CSS3BG] と同様に。
図形は、inset()、circle()、ellipse()、polygon() のいずれかに基づいて算出される。<shape-box> も給された場合、それが <basic-shape> 関数の基準ボックスを定義する。給されなかった場合の既定の基準ボックスは、margin-box になる。
図形用の座標系の原点は、基準ボックスの左上隅になる ─ ここで、x‐軸は右向き、y‐軸は下向きである。百分率で表出されるすべての長さは、基準ボックスの使用サイズから解決される。
margin-box
【2 つの式は[半径 = マージン]の所で一致するので、結果も そこを境に連続的に遷移する。】
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:1px solid #f00; background:linear-gradient(45deg,#808,#fff); shape-outside:margin-box; float:left; margin:10px; "></DIV>ああああああああああああああああああああああああああああああああああああ </DIV>
border-box
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:border-box; float:left; margin:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>
padding-box
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:padding-box; float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>
content-box
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:content-box; float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>
inset(<length-percentage>{1,4} [round <'border-radius'>]?)
内方へオフセットされた矩形を定義する。
いずれかの次元において、両側の inset の合計が基準ボックスの使用サイズを超える場合(左、右とも 75% など)、[CSS3BG] による § 曲線が重なり合う場合 と同じ規則を利用して、両側の比を保ちながら合計が 100% になるまで抑制する。これによる結果、図形の辺は、基準ボックスの中(inset が両側とも 75% の事例では、50% の所)に位置することになる。
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:inset(15px 30px); float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>
circle(<shape-radius>? [at <position>]?)
mdn
真円を定義する。
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:circle(40px); float:left; padding:10px; ">1</DIV>あああああああああああああああああああああああああああああああああああああああああああああああああああああああ </DIV>
ellipse([<shape-radius>{2}]? [at <position>]?)
楕円を定義する。
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:ellipse(40px 20px); float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああ </DIV>
polygon(<'fill-rule'>?, [<length-percentage> <length-percentage>]#)
多角形を定義する。
ユーザー エージェントは、このリストの最後の頂点から最初の頂点へ接続して多角形を閉じるものとする。
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:polygon(0% 0%, 50% 20%, 70% 70%, 0% 100%); float:left; padding:10px; ">1</DIV>あああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああ </DIV>
path([<'fill-rule'>,]? <string>)
パスによる図形を定義する。
ユーザー エージェントは、閉じたループを要求するプロパティ(shape-outside や clip-path など)において、文字列内に パスを閉じる 命令("z"/"Z")が無い場合には、暗黙的なそれでパスを閉じるものとする。
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:path('Com/Picture_Clip.gif','Z'); float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああああああああああ </DIV>¶SVGでないとできないようだ
真円/楕円 用の半径を定義する。省略時の既定の値は、closest-side 。
closest-side
真円用には、両次元にて最も近い側になる。
楕円用には、各半径に対し、当の次元にて最も近い側になる。
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:circle(closest-side); float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:ellipse(closest-side closest-side); float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>¶
farthest-side
真円用には、両次元にて最も遠い側になる。
楕円用には、各半径に対し、当の次元にて最も遠い側になる。
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:circle(farthest-side); float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>
<DIV style="width:200px; height:200px; border:1px solid black; font-size:15px; "> <DIV style="width:100px; height:100px; border:10px solid #f004; background:linear-gradient(45deg,#808,#fff); shape-outside:ellipse(farthest-side farthest-side); float:left; padding:10px; ">1</DIV>ああああああああああああああああああああああああああああああああああああ </DIV>¶
表示内容: |
表示内容: |