Div Horizontal Scrollbar and change div background when hovering - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to change Color

Description

Div Horizontal Scrollbar and change div background when hovering

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">
.container {<!-- w w  w  .  j a  va2  s.  co  m-->
   position:absolute;
   max-width:401px;
   background:gray;
}

.wrapper {
   width:100%;
   overflow:auto;
}

.item {
   display:inline-block;
   min-width:100%;
   white-space:nowrap;
   padding:6px;
   height:21px;
}

.item:hover {
   background:Chartreuse;
   color:yellow;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="wrapper"> 
    <div class="item">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliqua 
    </div> 
    <div class="item">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molest 
    </div> 
    <div class="item">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus s 
    </div> 
    <div class="item">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcor 
    </div> 
   </div> 
   <div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials