corner-block-start-shape
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Thuộc tính CSS corner-block-start-shape chỉ định hình dạng của cả hai góc ở cạnh block-start của một hộp, trong phạm vi vùng border-radius của chúng.
Để có mô tả đầy đủ về hành vi hình dạng góc và nhiều ví dụ, xem trang thuộc tính viết tắt corner-shape.
Các thuộc tính thành phần
Thuộc tính corner-block-start-shape là dạng viết tắt của các thuộc tính logic sau:
Cú pháp
/* Single keyword value set for both corners */
corner-block-start-shape: notch;
corner-block-start-shape: squircle;
/* Single superellipse() value set for both corners */
corner-block-start-shape: superellipse(2.7);
corner-block-start-shape: superellipse(-2.5);
/* Block-start/inline-start corner, block-start/inline-end corner */
corner-block-start-shape: notch squircle;
corner-block-start-shape: notch superellipse(-2.5);
/* Global values */
corner-block-start-shape: inherit;
corner-block-start-shape: initial;
corner-block-start-shape: revert;
corner-block-start-shape: revert-layer;
corner-block-start-shape: unset;
Giá trị
Thuộc tính corner-block-start-shape được chỉ định bằng một hoặc hai giá trị <corner-shape-value>:
- Nếu một giá trị được sử dụng, nó chỉ định hình dạng của cả hai góc block-start.
- Nếu hai giá trị được sử dụng, giá trị đầu tiên chỉ định hình dạng của góc block-start/inline-start, và giá trị thứ hai chỉ định hình dạng của góc block-start/inline-end.
Định nghĩa hình thức
| Initial value | as each of the properties of the shorthand:
|
|---|---|
| Applies to | all elements. It also applies to ::first-letter. |
| Inherited | no |
| Computed value | as each of the properties of the shorthand:
|
| Animation type | as each of the properties of the shorthand:
|
Cú pháp hình thức
corner-block-start-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 )
Ví dụ
Bạn có thể tìm các ví dụ liên quan khác trên trang tham chiếu corner-shape.
Cách dùng cơ bản của corner-block-start-shape
HTML
Mã đánh dấu cho ví dụ này chứa một phần tử <div> duy nhất.
<div></div>
CSS
Chúng ta cho hộp một số kiểu dáng cơ bản, được ẩn để ngắn gọn. Chúng ta cũng áp dụng box-shadow, border-radius là 40px 60px, và corner-block-start-shape là scoop notch.
div {
box-shadow: 1px 1px 3px gray;
border-radius: 40px 60px;
corner-block-start-shape: scoop notch;
}
Kết quả
Kết quả hiển thị như sau:
Thông số kỹ thuật
| Specification |
|---|
| CSS Borders and Box Decorations Module Level 4> # propdef-corner-block-start-shape> |
Khả năng tương thích trình duyệt
Xem thêm
corner-shapeshorthand propertycorner-block-end-shape,corner-inline-start-shape, andcorner-inline-end-shapecorner-top-shape,corner-bottom-shape,corner-left-shape, andcorner-right-shapeborder-radiusshorthand propertyborder-start-start-radiusandborder-start-end-radius- CSS borders and box decorations module
- CSS backgrounds and borders module