HTML CSS examples for CSS Widget:Hover
Hover to shrink background animation
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .item {<!-- ww w . j a va 2s . c o m--> -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -o-user-select:none; position:relative; display:inline-block; margin:0 11px; width:201px; height:100px } .item .label { position:absolute; top:-21px; left:0; width:201px; text-align:center } .item .thumb { position:absolute; top:0; left:0; z-index:10000; display:inline-block; background:Chartreuse; width:201px; height:100px; border:7px solid yellow; -webkit-transition:all .3s ease-out; -moz-transition:all .3s ease-out; -ms-transition:all .3s ease-out; -o-transition:all .3s ease-out; transition:all .3s ease-out; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; -ms-box-sizing:border-box; -o-box-sizing:border-box; box-sizing:border-box } .item .thumb:hover { background:blue; border-width:15px } .item .thumb:hover+.details { top:100px } .item .thumb:hover:after { background:lime } .item .thumb:after { content:' '; position:relative; display:block; top:51%; left:51%; margin-top:-26px; margin-lefT:-26px; width:51px; height:51px; background:lime; -webkit-border-radius:51px; -moz-border-radius:51px; -ms-border-radius:51px; -o-border-radius:51px; border-radius:51px; -webkit-background-clip:padding-box; -moz-background-clip:padding; -ms-background-clip:padding; -o-background-clip:padding; background-clip:padding-box; -webkit-transition:all .3s ease-out; -moz-transition:all .3s ease-out; -ms-transition:all .3s ease-out; -o-transition:all .3s ease-out; transition:all .3s ease-out } </style> </head> <body> <li class="item"> <div class="label"> Lorem ipsum </div> <div class="thumb"></div> <div class="details"> Lorem ips </div> </li> </body> </html>