CSS Shadows



The text-shadow: effect you can add text and elements.

In This lesson You will learn CSS text shadow and CSS boxx shadow.

CSS text shadow effect

Example

<!DOCTYPE html>
    <html>
    <head>
    <style>
    h1 {
      text-shadow: 1px 2px gray;
    }
    </style>
    </head>
    <body>
    
    <h1>Text-shadow effect</h1>
    
    </body>
    </html>
    


Click on the "Run This Code" button to see how it works.

CSS box shadow

Example

<!DOCTYPE html>
    <html>
    <head>
    <style> 
    div {
      width: 300px;
      height: 100px;
      padding: 15px;
      background-color: purple;
      box-shadow: 8px 9px;
    }
    </style>
    </head>
    <body>
    
    <h1>The box-shadow Property</h1>
    
    <div>This is a div element with a box-shadow</div>
    
    </body>
    </html>
    


Click on the "Run This Code" button to see how it works.





CSS

Welcome CSS Syntax CSS Selectors CSS ADD css CSS Borders CSS Backgrounds CSS Colors CSS Padding CSS Margin CSS Fonts CSS Text CSS Outline CSS Box-Model CSS Height&Width CSS Icons CSS Links CSS Lists CSS Display CSS Tables CSS Position CSS Overflow CSS Align CSS Float CSS Inline-block CSS Opacity CSS Image-Gallery CSS Navigation Bar CSS Dropdowns CSS Cursors CSS Forms CSS Pseudo-classes CSS Pseudo-elements

CSS3 FEATURES

CSS Gradients CSS shadows CSS 2D Transforms CSS 3D Transforms CSS Animations CSS Media Queries CSS Flexbox CSS important CSS Units