Page Widget How to - Float 100% width header








Question

We would like to know how to float 100% width header.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
html {<!--  w w  w .j av  a2  s .co  m-->
  height: 100%;
}

body {
  margin: 0px;
  padding: 0px;
  height: 100%;
  width: 100%;
  border-style: none;
  background: black;
}

#header {
  margin: 0px;
  padding: 0px;
  height: 15%;
  width: 100%;
  border-style: none;
  background: #02F72F;
  text-align: center;
  float: left;
}

#content {
  float: left;
  margin-top: 0px;
  padding: 0px;
  height: 70%;
  width: 100%;
  border-style: none;
  background: white;
  text-align: center;
}
</style>
</head>
<body>
  <div id="header">HEADER</div>
  <div id="content">
    <h3>Login</h3>
  </div>
</body>
</html>

The code above is rendered as follows: