Languages
[Edit]
EN

CSS - box-shadow example

4 points
Created by:
Palpys
464

In this article, we present an example of how to add shadow to the element using box-shadow property in CSS.

Quick solution:

// ONLINE-RUNNER:browser;

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style>

        .box {
            margin: 40px;
            padding: 40px;
            border-radius: 7px;
        }

        .box-shadow-1 {
            box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px;
            border: 1px solid #e0dede;
        }

        .box-shadow-2 {
            box-shadow: 10px 10px 8px #888888;
        }

        .box-shadow-3 {
            box-shadow: 0 0 6px 0 #616161;
        }

        .box-shadow-4 {
            box-shadow: rgba(17, 17, 26, 0.1) 6px 6px 15px 3px, rgba(17, 17, 26, 0.05) 4px 8px 32px;
        }

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

    </style>
</head>
<body style="max-width: 500px">
    <div class="box box-shadow-1">Example of box shadow using CSS</div>
    <div class="box box-shadow-2">Example of box shadow using CSS</div>
    <div class="box box-shadow-3">Example of box shadow using CSS</div>
    <div class="box box-shadow-4">Example of box shadow using CSS</div>
    <div class="box box-shadow-5">Example of box shadow using CSS</div>
</body>
</html>

See also

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join