HTML CSS examples for CSS Widget:Hover Border
Draw a border on top of a div when mouse in
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div {<!--from w ww . j av a 2s . co m--> width: 100px; height: 100px; text-align: center; background: yellow; box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; border: 10px solid transparent; } div:hover { border: 10px solid red; } button { width: 80px; margin: 0px auto; } </style> </head> <body> <div> <button>button</button> </div> </body> </html>