Margin-Top Menu usage - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

Margin-Top Menu usage

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 {<!--from ww  w.j a  va  2  s.c  o m-->
   background:url('https://www.java3s.com/style/demo/Google-Chrome.png') no-repeat center center fixed;
   -webkit-background-size:cover;
   -moz-background-size:cover;
   -o-background-size:cover;
   background-size:cover;
   font-family:custom;
   margin-top:0;
}

h2 {
   margin:0;
}

.container {
   width:1001px;
   margin-left:auto;
   margin-right:auto;
}

h2 {
   color:Chartreuse;
   font-size:51px;
}

@font-face {
   font-family:custom;
   src:;
}

.desc {
   width:1001px;
   margin-left:auto;
   margin-right:auto;
   background-color:yellow;
}

.menu {
   width:1001px;
}

.menu:last-child {
   float:clear;
}

.item {
   width:251px;
   height:51px;
   float:left;
   background-color:blue;
   transition:background-color 2s;
}

.item:hover {
   transition:background-color 2s;
   background-color:pink;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="menu"> 
    <div class="item">
      Lorem 
    </div> 
    <div class="item">
      Lorem 
    </div> 
    <div class="item">
      Lorem 
    </div> 
    <div class="item">
      Lorem 
    </div> 
   </div> 
   <h2>Lorem ips</h2> 
   <div class="desc"> 
    <em style="color: #00F7FF">Lorem ipsum dolor sit amet, consectetur a</em> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials