In CSS, the box-shadow property is used to add shadow effects to elements on a web page, creating a sense of depth and dimensionality. It allows web developers and designers to apply various types of shadows, such as drop shadows and inner shadows, to elements like divs, buttons, images, and other HTML elements.
selector { box-shadow: <horizontal-offset> <vertical-offset> <blur-radius> <spread-radius> <color> <inset>; }
Let's break down the values:
<!DOCTYPE html> <html lang="en"> <head> <title>Tutor Joes</title> <style> .box { height: 150px; width:150px; background:#FE6525; margin:30px; float:left; } .shadow { -webkit-box-shadow: 5px 5px 1px 0px rgba(0,0,0,0.15); -moz-box-shadow: 5px 5px 1px 0px rgba(0,0,0,0.15); box-shadow: 5px 5px 1px 0px rgba(0,0,0,0.15); } .shadow1{ box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3); } .shadow2{ box-shadow: inset 3px 3px 5px #888; } .shadow3{ box-shadow: 2px 2px 5px #555, -2px -2px 5px #555; } </style> </head> <body> <h1>Box Shadow In CSS</h1> <div class="box shadow"></div> <div class="box shadow1"></div> <div class="box shadow2"></div> <div class="box shadow3"></div> </body> </html>Live Preview
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions