这道题对高手来说是小菜一碟了
我是低手
在网上看到了阿里巴巴曾经的面试题,初看之下不会做,当然现在会了。我还是不用浮动
鼠标放上之前是这样子:
放上之后会放大,这个样子:
面试题要求用js实现放大的效果,我是用了css3
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>阿里巴巴面试题</title>
<style>
body{ margin:0; padding:0}
div{background:#CCCCCC; position:absolute}
#first{width:100px; height:150px}
#second{top:160px;width:100px;height:150px}
#third{ width:200px; height:310px; left:110px}
#forth{width:210px;height:150px;left:320px;}
#fifth{width:100px;height:150px;left:320px;top:160px;}
#sixth{width:100px;height:150px;left:430px;top:160px;}
div:hover{-webkit-transform:scale(1.25,1.25);
transform:scale(1.25,1.25);
-moz-transform:scale(1.25,1.25);
background:red;}
</style>
</head>
<body>
<div id="first">1</div>
<div id="second">2</div>
<div id="third">3</div>
<div id="forth">4</div>
<div id="fifth">5</div>
<div id="sixth">6</div>
</body>
</html>
写在这里,以后自己看