px

px

px

px

px

12345
CSS
box-shadow:-webkit-box-shadow:-moz-box-shadow:
5px 5px 10px 2px rgba(0, 30, 60, 0.8);5px 5px 10px 2px rgba(0, 30, 60, 0.8);5px 5px 10px 2px rgba(0, 30, 60, 0.8);

CSS Box Shadow generator online

CSS box shadow is a front-end design effect style that adds depth and dimension to elements on a web page. It allows designers to create mind-bending visual effects around the HTML elements such as a raised button, a floating card, or a 3D border around an element.

How to apply CSS box shadow into element?

You need to use the box-shadow property in your CSS code to add a box shadow to an element. The property accepts a series of values that define the shadow's size, position, color, and blur.

The syntax of the box-shadow property is:

box-shadow: h-shadow v-shadow blur spread color inset;

  • h-shadow specifies the horizontal offset of the shadow from the element. Positive values move the shadow to the right, and negative values move it to the left.

  • v-shadow specifies the vertical offset of the shadow from the element. Positive values move the shadow down, and negative values move it up.

  • blur specifies the blur radius of the shadow. The higher the value, the more the shadow will be blurred.

  • spread specifies the spread radius of the shadow. The higher the value, the larger the shadow will be.

  • color specifies the color of the shadow. You can use any valid CSS color value, such as a hex code, RGB value, or color name.

  • inset is an optional value that changes the shadow from an outer shadow to an inner shadow. An inner shadow appears inside the element, while an outer shadow appears outside it.

Here's an example of how to use the box-shadow property in CSS:

.box { box-shadow: 3px 3px 5px 0 rgba(0, 0, 0, 0.4); }

In this example, the .box element will have a shadow that is 3 pixels to the right and 5 pixels down, with a blur radius of 4 pixels and a spread radius of 0. The shadow color is black with an opacity of 0.4

How to add CSS box shadow bottom only?

If you want to add a box shadow to the bottom of an element only, you can do it by setting the horizontal and vertical offsets to 0, and the blur and spread radius to your desired values.

Here's an example:

.box { box-shadow: 0 5px 4px -3px rgba(0, 0, 0, 0.4); }

In this example, the .box element will have a box shadow that is 4 pixels below it, with a blur radius of 5 pixels and a spread radius of -3 pixels. The spread radius of -3 pixels will cause the shadow to only appear at the bottom of the element, while the blur radius creates a soft edge to the shadow.

How to blur CSS box shadow?

To blur a box shadow in CSS, you can use the blur value in the box-shadow property. The blur value specifies the radius of the blur effect applied to the shadow and can be set to any positive value.

Example:

.box { box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); }

In this example, the .box element will have a box shadow that is 15 pixels in size and has a black color with an opacity of 0.3. The shadow will be blurred due to the blur value being set to 15 pixels.

History of CSS Box Shadow

The box-shadow property was introduced as part of the CSS3 specification in 1999. However, the first working draft of the specification, which included the box-shadow property, was not released until 2003.

Over the years, the specification went through multiple revisions and updates, and the box-shadow property evolved alongside it. It was eventually finalized and became part of the CSS2.1 specification in 2011.

Since then, box-shadow has become a widely used and popular CSS property. It allows developers to add depth and dimension to their designs without the need for complex graphics or images. Its versatility and ease of use make it a valuable tool for creating modern, sleek, and professional-looking web designs.

However, manually coding box shadow properties in CSS can be time-consuming and difficult, especially for those who are not familiar with CSS coding. This is where our WebCodeTool CSS box shadow generator come in handy.

© 2023 WebCodeTool