-1

I have some CSS in which in some properties inside CSS definition starts with -webkit prefix

For example, in the following CSS there are one properties prefixed with a -webkit for text

 p {
       background-image: linear-gradient(to right, #f1c40f, #27ae60);
       -webkit-background-clip: text;
       background-clip: text;
}
  • 3
    See https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix. It targets a certain class of browser. It's rarely used anymore since most browsers implement standards. – user2740650 Mar 06 '22 at 03:23

1 Answers1

0

WebKit is a web browser engine used by some browsers like Safari.

Some CSS properties with the -webkit prefix will target only the browsers using the WebKit engine. The CSS rule with the -webkit prefix will only apply to browsers using the WebKit engine.

For example:

div{-webkit-opacity: 0.5;}

For users viewing the website on a WebKit-based browser, the div will have the opacity of 0.5. For users viewing the webpage on a non-WebKit browser, the div will be fully opaque, i.e, the rule will not apply.

potato
  • 79
  • 1
  • 11