1. 程式人生 > >css計數器 及 鼠標經過從中間擴散一個矩形(正方形長方形均可)

css計數器 及 鼠標經過從中間擴散一個矩形(正方形長方形均可)

aaa ack before har :after div near one css

<!DOCTYPE html>
<html>
<head>
    <title>css計數器--兼容IE8</title>
    <meta charset="utf-8"/>
    <style type="text/css">
        *{
            margin:0;
            padding:0;
        }
        ul{
            list-style: none;
            counter-reset: list;
        }
li{ position: relative; width: 100px; height: 100px; border:1px solid #ccc; counter-increment: item; } li:after{ content: ‘‘; display: block; width: 0; height: 0; position
: absolute; top: 50%; left: 50%; transition:all .3s linear; opacity: 0; background: #000; } li:hover:after{ width: 100%; height: 100%; top: 0; left:0; opacity: 0.3; } li:before
{ content: counter(item)"."; display: inline-block; } </style> </head> <body> <ul> <li> aaa </li> <li> aaa </li> <li> aaa </li> </ul> </body> </html>

css計數器 及 鼠標經過從中間擴散一個矩形(正方形長方形均可)