Skewed background and hover-effect with hidden overflow - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to change Color

Description

Skewed background and hover-effect with hidden overflow

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">
#header-top {
   height:100px;
   background:gray;
   left:0;
   position:fixed;
   right:0;
   top:0;
   z-index:100;<!--   w w w .ja v  a  2  s  .  c o  m-->
}

#header-top:after {
   background:Chartreuse;
   content:"";
   height:121px;
   position:absolute;
   top:75px;
   left:0px;
   transform:skewY(-4deg);
   width:100%;
   z-index:6;
}

#main-navigation ul {
   display:inline;
   float:right;
   padding:0;
   margin:0;
}

#main-navigation ul li {
   display:inline;
   line-height:31px;
}

#main-navigation ul li a {
   display:inline-block;
   font-size:15px;
   font-weight:401;
   color:yellow;
   padding:21px;
}

#main-navigation ul li a:hover {
   padding:21px;
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <header> 
   <div id="header-top"> 
    <nav id="main-navigation" role="navigation"> 
     <ul class="menu"> 
      <li> <a href="#">Lore</a> </li> 
      <li> <a href="#">Lorem</a> </li> 
      <li> <a href="#">Lorem </a> </li> 
      <li> <a href="#">Lorem i</a> </li> 
     </ul> 
    </nav> 
   </div> 
  </header>  
 </body>
</html>

Related Tutorials