Home > Net >  What does the -webkit prefix before some properties in css mean?
What does the -webkit prefix before some properties in css mean?

Time:03-06

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;
}

CodePudding user response:

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.

CodePudding user response:

according to MDN:
WebKit is a framework that displays properly-formatted webpages based on their markup. Apple Safari depends on WebKit, and so do many mobile browsers (since WebKit is highly portable and customizable). WebKit began life as a fork of KDE's KHTML and KJS libraries, but many individuals and companies have since contributed (including KDE, Apple, Google, and Nokia). WebKit is an Apple trademark, and the framework is distributed under a BSD-form license. However, two important components fall under the LGPL: the WebCore rendering library and the JavaScriptCore engine.

Its a bit a hard to understand what they are talking about but you can learn more at the wikipedia page about webkit. I hope this answer helps you.

  • Related