HTML Element Style How to - Div with shadows








Question

We would like to know how to div with shadows.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.tab-shadow {<!--from   w ww . java2s.c om-->
  box-shadow: 2px -2px 6px #333333; /*standard CSS3*/
  -moz-box-shadow: 2px -2px 6px #333333; /*firefox*/
  -webkit-box-shadow: 2px -2px 6px #333333; /*webkit (safari, chrome*/
  filter: progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=310,
    Color=? #000000'); /*ie*/
  height: 100px;
  width: 200px;
  border: 1px dashed #f00;
  background: #fff;
}
</style>
</head>
<body>
  <div class="tab-shadow">&nbsp;</div>
</body>
</html>

The code above is rendered as follows: