Skip to content

Instantly share code, notes, and snippets.

@geekboots-team
Created September 9, 2024 15:58
Show Gist options
  • Select an option

  • Save geekboots-team/9ae4e66ed1c76049e95ec0c87f30a922 to your computer and use it in GitHub Desktop.

Select an option

Save geekboots-team/9ae4e66ed1c76049e95ec0c87f30a922 to your computer and use it in GitHub Desktop.
Difference box-shadow and drop-shadow in CSS and how it is different?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background: #212121;
}
section {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
img {
/* Box Shadow */
box-shadow: 0 0 15px #fbf792;
/* Drop Shadow */
filter: drop-shadow(0 -5px 15px #fbf792);
}
</style>
</head>
<body>
<section>
<img src="princess.png" alt="" width="250" />
</section>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment