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 |
浏览器兼容性
加载中…