To create CSS3 Box and Text Shadow effects, use the box-shadow and text-shadow property, respectively.
Following is the code to create CSS3 Box and text shadow effects −
Example
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
h2 {
color: rgb(28, 0, 128);
text-shadow: red 2px 4px 2px;
}
div {
color: white;
text-align: center;
width: 150px;
height: 150px;
background-color: red;
box-shadow: rgb(89, 0, 255) 8px 2px 8px;
}
</style>
</head>
<body>
<h1>Shadow effect example</h1>
<h2>Text shadows</h2>
<div>BOX SHADOW</div>
</body>
</html>Output
The above code will produce the following output −
