Header aligned to the edge on the top - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Header aligned to the edge on the top

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

body {<!-- w ww  .ja v  a  2 s.  com-->
   margin: 0 auto;
   padding: 0;
   font-family: Calibri;
   background-image: url('https://www.java2s.com/style/demo/Firefox.png');
   background-repeat: no-repeat;
   background-attachment: fixed;
}
header {
   background: rgb(0, 0, 0);
   background: rgba(0, 0, 0, 0.5);
   color: white;
   width: 100%;
   height: 34px;
   box-shadow: 0px 3px 3px black;
   margin: 0 auto;
}
header #header-content {
   padding: 10px;
}
#welcome {
   display: inline;
}
ul {
   list-style-type:none;
   margin:0;
   padding:0;
   float: right;
}
li {
   display: inline;
}
a {
   text-decoration: none;
   padding: 10px;
   color: white;
}
a:hover {
   color: yellow;
}
#parent-container {
   width: 200px;
   height: 700px;
   background-color: black;
   margin: 0 auto;
   margin-top: 0px;
   background: rgb(0, 0, 0);
   background: rgba(0, 0, 0, 0.5);
}


      </style> 
 </head> 
 <body> 
  <header> 
   <div id="header-content"> 
    <p id="welcome">Welcome, test test test!</p> 
    <ul> 
     <li> <a href="#">Sign in</a> </li> 
     <li> <a href="#">Sign up</a> </li> 
    </ul> 
   </div> 
  </header> 
  <div id="parent-container"> 
  </div>  
 </body>
</html>

Related Tutorials