corner-top-shape
corner-top-shape CSS 屬性用於指定盒子頂部邊緣的兩個角的形狀,在它們的 border-radius 區域內。
有關角形狀行為的完整描述和多個示例,請參見 corner-shape 簡寫屬性頁面。
構成屬性
corner-top-shape 屬性是以下物理屬性的簡寫形式
語法
css
/* Single keyword value set for both corners */
corner-top-shape: notch;
corner-top-shape: squircle;
/* Single superellipse() value set for both corners */
corner-top-shape: superellipse(3);
corner-top-shape: superellipse(-1.5);
/* Left-hand corner, right-hand corner */
corner-top-shape: notch squircle;
corner-top-shape: notch superellipse(-1.5);
/* Global values */
corner-top-shape: inherit;
corner-top-shape: initial;
corner-top-shape: revert;
corner-top-shape: revert-layer;
corner-top-shape: unset;
值
corner-top-shape 屬性透過使用一個或兩個 <corner-shape-value> 值來指定
- 如果使用一個值,它指定兩個頂部角的形狀。
- 如果使用兩個值,第一個值指定左上角的形狀,第二個值指定右上角的形狀。
正式定義
在資料庫中未找到值!正式語法
corner-top-shape =
<'corner-top-left-shape'>{1,2}
<corner-top-left-shape> =
<corner-shape-value>
<corner-shape-value> =
round |
scoop |
bevel |
notch |
square |
squircle |
<superellipse()>
<superellipse()> =
superellipse( <number [-∞,∞]> |
infinity |
-infinity )
示例
你可以在 corner-shape 參考頁面上找到其他相關示例。
corner-top-shape 的基本用法
HTML
此示例的標記包含一個單獨的 <div> 元素。
html
<div></div>
CSS
我們給盒子設定了一些基本樣式,為了簡潔起見我們隱藏了它們。我們還應用了一個 box-shadow,一個 60 畫素的 border-radius,以及 scoop notch 的 corner-top-shape。
css
div {
box-shadow: 1px 1px 3px gray;
border-radius: 60px;
corner-top-shape: scoop notch;
}
結果
渲染結果如下所示:
規範
| 規範 |
|---|
| CSS Borders and Box Decorations Module Level 4 # propdef-corner-top-shape |
瀏覽器相容性
載入中…