clip:rect 隐藏控件


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="http://www.wxwdesign.cn/works/" />
    <style type="text/css">
        body
        {
            margin: 0px;
            padding: 0px;
            font-size: 13px;
        }
.clip_a
{display:block; width:128px; height:128px;}

.clip_a img
{border:0; position:absolute; clip:rect(0 2560px 2560px 0);}

 

.clip_a:hover img
{position:absolute; clip:rect(128px 0px 0px 128px);}
    </style>

 

<a href="javascript:" class="clip_a"><img src="http://pic1a.nipic.com/2008-12-

18/2008121893348627_2.jpg" /></a>

这个必须是position:absolute的元素哦,当鼠标放在郁金香的图片上的时候,郁金香就没了

</body>
</html>

posted @ 2011-08-25 22:18  zicheng_307  阅读(235)  评论(0编辑  收藏  举报