Sitemap
Pravin M

Pravin M

I am a frontend developer with 10+ years of experience Blog :- https://www.frontendinterviewquestions.com

Member-only story

Box shadow using CSS

3 min readJul 25, 2024
Press enter or click to view image in full size
Box shadow using CSS

For more questions and answers visit our website at Frontend Interview Questions

Box shadows in CSS are a powerful styling feature that allows developers to add depth and dimension to elements on a webpage. Whether you want to create a subtle effect or make elements pop off the screen, understanding how to apply box shadows effectively is essential. In this article, we’ll explore the basics of box shadows in CSS, along with some practical examples to demonstrate their usage.

Basics of Box Shadow

Box shadows are created using the box-shadow property in CSS. This property accepts values that define the horizontal and vertical offsets of the shadow, blur radius, spread radius, and color of the shadow. Here’s the syntax:

selector {
box-shadow: h-offset v-offset blur spread color;
}
  • h-offset: Specifies the horizontal offset of the shadow. A positive value moves the shadow to the right, while a negative value moves it to the left.
  • v-offset: Specifies the vertical offset of the shadow. A positive value moves the shadow downwards, and a negative value moves it upwards.
  • blur: Optional. Specifies the blur radius. The higher the value, the more blurred the shadow becomes. Default is 0.
  • spread: Optional. Specifies the spread…

--

--

Pravin M
Pravin M

Written by Pravin M

I am a frontend developer with 10+ years of experience Blog :- https://www.frontendinterviewquestions.com