Thuộc tính neo bù đắp CSS
Ví dụ
Cố định điểm giữa bên phải của phần tử <img> vào đường dẫn đã xác định:
img {
offset-path: path('M 50 80 C 150 -20 250 180 350 80');
offset-anchor: right center;
}
Hãy tự mình thử »Định nghĩa và cách sử dụng
Thuộc tính offset-anchor
chỉ định điểm trên một phần tử được cố định dọc theo đường dẫn được xác định bởi thuộc tính offset-path
.
Điểm được xác định bởi thuộc tính offset-anchor
cũng sẽ là tâm quay nếu phần tử được xoay với thuộc tính offset-rotate
.
Lưu ý: Thuộc tính này hiện chỉ hoạt động với trình duyệt Firefox.
Giá trị mặc định: | tự động |
---|---|
Thừa hưởng: | KHÔNG |
Hoạt hình: | Đúng. Đọc về hoạt hình Hãy thử nó |
Phiên bản: | CSS3 |
Cú pháp JavaScript: | object .style.offsetAnchor="dưới cùng bên phải" Hãy thử |
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Property | |||||
---|---|---|---|---|---|
offset-anchor | Not supported | Not supported | 72.0 | Not supported | Not supported |
Cú pháp CSS
offset-anchor: auto| value |initial|inherit;
Giá trị tài sản
Value | Description |
---|---|
auto | Default. The achored point will be in the center of the element, same as property value '50% 50%'. |
left top left center left bottom right top right center right bottom center top center center center bottom | If you only specify one keyword, the other value will be "center" |
xpos ypos | The first value is the horizontal position and the second value is the vertical. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units . If you only specify one value, the other value will be 50%. You can mix % and positions |
x% y% | The first value is the horizontal position and the second value is the vertical. The top left corner is 0% 0%. The right bottom corner is 100% 100%. If you only specify one value, the other value will be 50%. Default value is: 50% 50% |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Trang liên quan
Hướng dẫn SVG HTML: Đường dẫn SVG
Hướng dẫn CSS: Hoạt hình CSS
Thuộc tính CSS offset: Thuộc tính CSS Offset
Thuộc tính khoảng cách bù đắp CSS: Thuộc tính khoảng cách bù đắp CSS
Thuộc tính đường dẫn bù đắp CSS: Thuộc tính đường dẫn bù đắp CSS
Thuộc tính xoay offset của CSS: Thuộc tính CSS Offset-rotate