The Wayback Machine - https://web.archive.org/web/20241003112922/https://www.geeksforgeeks.org/difference-between-webkit-box-shadow-box-shadow-in-css/
Open In App

Difference between -webkit-box-shadow & box-shadow in CSS

Last Updated : 26 Apr, 2021
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In this article, we will find difference between ‘webkit-box-shadow’ & ‘box-shadow’ in CSS.

Webkit-box-shadow: The webkit-box-shadow property in CSS is used to apply a box-shadow. The webkit-box-shadow is a browser-specific implementation for WebKit browsers like Google Chrome and Safari.

  • Syntax:
    webkit-box-shadow: h-offset v-offset blur;
  • Advantage: If we use -webkit-box-shadow the old versions of browsers support it.

Box-shadow: The box-shadow property in CSS is used to apply a box-shadow. The box-shadow is the CSS standard implementation.

  • Syntax: 
    box-shadow: h-offset v-offset blur;
  • Advantage: If we use box-shadow latest versions of browsers support it.

There are some differences between box-shadow and -webkit-box-shadow properties which are following:

Box-shadow Webkit-box-shadow     
The box-shadow is the CSS standard implementation. While the webkit-box-shadow is a browser-specific implementation for WebKit Browsers like Google Chrome and Safari.
The box-shadow property is for the latest versions. Whereas the webkit-box-shadow property is used for older versions.

Example:

HTML




<!DOCTYPE html>
<html>
  
<head>
    <style>
        .gfg1{
            color: green;
            cursor: zoom-in;
            border: solid 2px red;
            margin: 10% 30%;
            width: 50%;
            box-shadow: 5px 10px 18px red;
            -webkit-box-shadow: 5px 10px 18px red;
        }
    </style>
</head>
  
<body>
    <div class="gfg1">
        <h1>GeeksforGeeks</h1>
        <p>box-shadow</p>
  
    </div>
</body>
  
</html>


Output:



Similar Reads

Understanding CSS Shadows: Box Shadow vs. Drop Shadow
We're going to explore CSS shadows and breaking down the key differences between "Box Shadow" and "Drop Shadow." Understanding these properties can help you create more engaging and visually appealing web designs. What is Box Shadow?Box shadow is a CSS property that allows you to add shadow effects to elements on a web page. This property allows yo
5 min read
CSS -webkit-appearance
The -webkit-appearance property in CSS is used by WebKit-based browsers such as Safari. Note that Firefox and Edge also support -webkit-appearance, for compatibility for some reasons. Although, -webkit-appearance property is supported by some modern browsers but still there is a small difference. Syntax: element{ webkit-appearance:values; } Paramet
2 min read
CSS | ::-webkit-scrollbar
::-webkit-scrollbar is a pseudo-element in CSS employed to modify the look of a browser's scrollbar. Before we start with how it works and how can it be implemented, we need to know some facts about the element. Browsers like Chrome, Safari and Opera support this standard Browsers like firefox don't support this For the webkit browsers, you can use
3 min read
CSS webkit-line-clamp Property
The -webkit-line-clamp property is used to limit the amount of lines that a block container may contain. This property only has an effect when the display property is set to '-webkit-box' or '-webkit-inline-box' and the '-webkit-box-orient' property is set to 'vertical'. Syntax: -webkit-line-clamp: none | integer | initial | inherit Property Values
3 min read
How to create long shadow of text without using text-shadow in HTML and CSS ?
Shadows are really a nice way to give depth and 3-D look to any text. Generally, we use text-shadow to give shadow to the text but this shadow is short and to create long shadow (shadow in which text is visible like that of reflection) we have to use before selector and skew function. Approach: The approach is to use a skew to create tilted text fi
2 min read
How to Access USB Devices from Node-Webkit ?
Node-Webkit, now known as NW.js, is a framework that allows developers to build desktop applications using web technologies like HTML, CSS, and JavaScript while providing access to Node.js capabilities. One of the powerful features of NW.js is the ability to interact with hardware devices, including USB devices. This article will guide you through
4 min read
How to style scrollbar thumb for the webkit browsers and what are components of scrollbar ?
We use the scrollbar daily while using the web. Scrollbars are tools with the help of which we can scroll the content of our webpage. The problem with the default scrollbars is that they always appear in the same dull gray color. But then how to make them look good? In this article, we will learn how to make a scrollbar look good. What are the comp
2 min read
How to add a box-shadow on one side of an element using CSS?
The box-shadow property is used to set the box shadow on one side of element. Syntax: box-shadow: h-offset v-offset blur spread color; box-shadows values: h-offset: It is required and used to set the position of the shadow horizontally. The positive value is used to set the shadow on right side of the box and a negative value is used to set the sha
2 min read
Primer CSS Extra large Box Shadow
Primer CSS is a free open-source CSS framework that is built upon systems that create the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture
2 min read
How to apply box-shadow to display elements like single element to user in CSS ?
In CSS, the box-shadow property allows you to add a shadow effect to an element. However, when it comes to applying box shadow to a combination of elements such as a <span> and <input>, it can be a bit tricky to get the desired effect. In this article, we will discuss how to apply box-shadow to a <span> <input> combination s
2 min read
Primer CSS Box Shadow Remove
Primer CSS is a free open-source CSS framework that is built upon systems that create the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture
2 min read
Primer CSS Large Box Shadow
Primer CSS is a free open-source CSS framework that is built upon systems that create the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture
2 min read
Primer CSS Medium Box Shadow
Primer CSS is a free open-source CSS framework that is built upon systems that create the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture
2 min read
Primer CSS Small Box Shadow
Primer CSS is a free open-source CSS framework that is built upon systems that create the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture
2 min read
Primer CSS Box shadow
Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, an
4 min read
CSS Box Shadow Bottom Only
CSS box-shadow property adds a shadow effect to an HTML element. It allows you to create a shadow behind an element, which can give the element depth and make it stand out on the page. In this article, we will see the Box Shadow Bottom Only in CSS. For this, we will implement 2 different approaches: Using the box-shadow propertyUsing the ::after ps
3 min read
How to Set Depth of Box Shadow in CSS ?
A powerful CSS box-shadow attribute may give web designs depth and dimension. Although CSS box-shadow first appears to be a straightforward property, there are many ways to use it to produce intricate shadow effects that can improve a website's aesthetic appeal and user experience. In this article, we will see & dip deep into CSS box-shadow and
7 min read
How to Create a Box Shadow in CSS ?
A box shadow in CSS is a visual effect that adds a shadow to an HTML element, creating a sense of depth and dimension. It is a styling technique commonly used to enhance the visual appearance of elements on a webpage. Below are the approaches to creating a box shadow in CSS: Table of Content Using box-shadow propertyUsing the filter propertyCreate
2 min read
Tailwind CSS Box Shadow
This class accepts lots of value in tailwind CSS in which all the properties are covered in class form. By using this class we can control the box-shadow of an element. In CSS, we do that by using the CSS Shadow Effect properties of box-shadow.  Box Shadow classes: shadow-sm: This class is used to create a faded or small shadow effects on the box.s
2 min read
How to Apply Inset to Box Shadow in Tailwind CSS?
In web development, shadows play a significant role in attracting user attention. By applying shadows to elements on our web pages, we can enhance their visual appearance and attract the user's focus. In Tailwind CSS, we can apply an insert box shadow by using the "shadow-inner" utility class. ApproachFirst, create a basic HTML structure and includ
2 min read
CSS box-shadow Property
The CSS box-shadow property is used to add a shadow effect to the edges of an element. You can apply multiple shadows by separating them with commas. The shadow is defined by the X and Y offsets (which position the shadow), a blur radius, a spread radius, and a color. By default, the value is set to none, meaning no shadow is applied. This property
6 min read
How to do box shadow with progress bar style using bootstrap?
Progress bars are used to show the progress of a process. Box shadow with progress bar style highlights the user progress of a task/process with box-shadow effect. Syntax: <td style="box-shadow: px px px px rgba()"></td> Return Value: It returns box shadow with progress bar style. Example 1: <!DOCTYPE html> <html lang="en
2 min read
How to add Box-Shadow to The Clip-Path Object ?
As we all know that we can apply the shadow using the Box-Shadow attribute of CSS, but it is not valid if we apply it on the clipped Object using Clip-Path() function of CSS. Approach: We are going to create two divs, one for the main and the other for our clipped shape.Then we are going to use the drop-shadow() function to apply shadow effects. HT
2 min read
Tachyons Theming Box Shadow
Tachyons are a CSS toolkit that is used to design a responsive website using the tachyons classes. In this article, we will learn how to include box-shadow using the Tachyons toolkit. Box-shadow is the shadow of the box and we can define this shadow by using the Tachyons classes. Used Classes: shadow-1: This class is used to create a box-shadow 4px
2 min read
How to Create Card with Box Shadow in React Native ?
Creating Card with box shadow in react native makes it stand out within the interface and display information in an appealing way. It will be done in React Native by using the expo cli. Expo simplifies cross-platform app development by providing a unified codebase for iOS, Android, and the web. With its tools and services, developers can create hig
4 min read
How to Set Box Shadow in React JS ?
The CSS property box-shadow is used to set box shadow in React. This can apply to any React.js component. The CSS box-shadow property creates shadow effects around an element's frame possible to set several effects at once by separating them with commas. A box shadow is defined by the element's X and Y offsets, blur and spread radius, and color. In
3 min read
Build a Box Shadow Generator Using React JS
In this article, We will create a box shadow generator using React Js. The application enables customization of various aspects of a box shadow, including position, size, color, opacity, and whether it should be inset or outset. Preview of final output: Let us have a look at how the final output will look like. Prerequisites / Technologies Used:Rea
4 min read
How to change/update CSS class dynamically using amp-bind in Google AMP ?
Sometimes you want to add custom interactivity to your AMP pages to make your pages look more user-friendly and user calling. Although AMP's pre-built components are limited, so amp-bind is made to overcome this problem. It helps the developer to add custom interactivity to the pages without using AMP's pre-built components. You can use amp-bind to
3 min read
Difference between alert box and prompt box in JavaScript
1. Alert box : An alert box is one type of popup boxes in JavaScript which is often used to make sure that information have come through the user. So, the user will have to click "OK" to proceed when an alert box pops up on the window. Syntax : window.alert("message"); Another syntax to use alert box is : alert("message"); 2. Prompt box : It is als
2 min read
Difference between alert box and confirmation box in JavaScript
In JavaScript, alert and confirm are two built-in functions used to interact with users via dialogue boxes. Both serve different purposes and provide distinct functionalities. Understanding the difference between an alert box and a confirmation box is crucial for effective user interface design and user interaction management. Table of Content Aler
3 min read