خاصية مسار مقطع CSS
مثال
قص صورة لدائرة 50٪:
img {
clip-path:
circle(50%);
}
التعريف والاستخدام
تتيح لك الخاصية قص clip-path
عنصر إلى شكل أساسي أو إلى مصدر SVG.
ملاحظة: ستحل الخاصية محل الخاصية clip-path
الموقوفة clip
.
القيمة الافتراضية: | لا أحد |
---|---|
وارث: | رقم |
متحرك: | نعم للشكل الأساسي . اقرأ عن animatable |
الإصدار: | وحدة إخفاء CSS المستوى 1 |
بناء جملة JavaScript: | الكائن .style.clipPath = "الدائرة (50٪)" |
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
Property | |||||
---|---|---|---|---|---|
clip-path | 55.0 23.0 -webkit- |
79.0* | 54.0 | 9.1 6.1 -webkit- |
42.0 15.0 -webkit- |
* قبل الإصدار 79 ، كانت Edge تدعم فقط مسار القصاصة على عناصر SVG (وليس عناصر HTML).
بنية CSS
clip: clip-source|basic-shape|margin-box|border-box|padding-box|content-box|fill-box|stroke-box|view-box|none|initial|inherit;
قيم الملكية
Value | Description | Play it |
---|---|---|
clip-source | Defines a URL to an SVG <clipPath> element | |
basic-shape | Clips an element to a basic shape: circle, ellipse, polygon or inset | |
margin-box | Uses the margin box as the reference box | |
border-box | Uses the border box as the reference box | |
padding-box | Uses the padding box as the reference box | |
content-box | Uses the content box as the reference box | |
fill-box | Uses the object bounding box as reference box | |
stroke-box | Uses the stroke bounding box as reference box | |
view-box | Uses the SVG viewport as reference box | |
none | This is default. No clipping is done | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |