HTML Element Style How to - Create float effect header








Question

We would like to know how to create float effect header.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
header {<!-- ww  w  .  ja va 2  s .com-->
  position: static;
  z-index: 2;
  width: 100%;
  height: 100px;
  margin: 0;
  padding: 0;
  background-color: #92BDD3;
  border: none;
  border-top: 1px solid #CCC;
  -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 3px 10px;
  -moz-box-shadow: rgba(0, 0, 0, 0.3) 0 3px 10px;
  box-shadow: rgba(0, 0, 0, 0.3) 0 3px 10px;
}
</style>
</head>
<body>
  <header> </header>
</body>
</html>

The code above is rendered as follows: