Skip to main content

常用设置

关闭元素图片拖拽

方法1

img {
-webkit-user-drag: none;
}

设置对<img>元素 设置user-drag:none

获取视口宽高

<body></body>


<style>
@property --vh{
sytanx: '<length>';
inherits: true;
initial-value: 100vh;
}
@property --vw{
sytanx: '<length>';
inherits: true;
initial-value: 100vw;
}

:root{
--w: tan(atan2(var(--vw), 1px));
--h: tan(atan2(var(--vh), 1px));
}

boody::before{
coutent: counter(w) " x " counter(h);
counter-reset: w var(--w) h var(--h);
font-size: 150px;
font-weiht: 900;
position: fixed;
inset: 0;
width: fit-content;
height: fit-content;
margin: auto;
}
</style>