放大镜
作者:互联网
放大镜大家都不陌生,这次我就用js写一个放大镜
css代码
-
{
margin: 0;
padding: 0;
}.kk { display: flex; } .box { width: 500px; height: 400px; border: 1px solid red; user-select: none; } .box .img img { width: 500px; height: 400px; } .box .box1 { width: 100px; height: 100px; background-color: rgb(255, 0, 0, 0.8); position: absolute; top: 0; left: 0; /* margin-top: -404px; */ } .box2 { width: 500px; height: 400px; background: url(11.jpg) no-repeat; background-size: 500% 400%; border: 1px solid red; margin-left: 50px; }
html代码
js代码
效果图:
标签:box,放大镜,height,width,background,400px,500px 来源: https://www.cnblogs.com/s272/p/15006378.html