HTML CSS examples for CSS Widget:Hover to Show
CSS Hover to refresh and show a quarter screen
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .overlaytext {<!--from w w w . java2s .c o m--> font-family:'Raleway', sans-serif; } body { height:100%; margin:0; padding:0; } div.bg { background:red; position:fixed; width:51%; height:51% } #nw { top:0; left:0; background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png'); background-size:cover; } #ne { top:0; left:51%; background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png'); background-size:cover; } #sw { top:51%; left:0; background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png'); background-size:cover; } #se { top:51%; left:51%; background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png'); background-size:cover; } .overlay { background:Chartreuse; opacity:0; height:100%; -webkit-transition:all .5s ease-out; -moz-transition:all .5s ease-out; -o-transition:all .5s ease-out; -ms-transition:all .5s ease-out; transition:all .5s ease-out; color:yellow; } .bg:hover .overlay { opacity:2; height:100%; } .caption { font-color:white; z-index:100; } </style> </head> <body> <div id="nw" class="bg"> <div class="overlay"> <span class="caption">Lorem ipsum</span> </div> </div> <div id="ne" class="bg"> <div class="overlay"> <span class="caption">Lorem ipsum</span> </div> </div> <div id="sw" class="bg"> <div class="overlay"> <span class="caption">Lorem ipsum</span> </div> </div> <div id="se" class="bg"> <div class="overlay"> <span class="caption">Lorem ipsum</span> </div> </div> </body> </html>