大屏记录

原创
2021/04/28 15:39
阅读数 110
<!DOCTYPE HTML>
<html>
<head>
<title>大屏测试</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
<style>
	html,body{
		width:100%;
		height:100%;
	}
	#app{
		width:100%;
		height:100%;
		background:url('./bg.png');
		background-size: 100%;
    	background-repeat: no-repeat;
    	position:relative;
	}
	#num{
		    position: absolute;
    left: 41rem;
    top: 62rem;
    color: #fff;
    font-size: 4rem;
	}
</style>
</head>

<body>

<div id="app">
	<div id="num">1000</div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script>
     function rem() {
	    let designSize = 1920; //1920宽度分辨率
	    let html = document.body||document.documentElement;
	    let wW = html.clientWidth
	    let rem = wW / designSize * 62.5
	    $('html').css('font-size', rem + '%')
	}
	$(window).resize(function() {
	    rem()
	})
	rem()
</script>
</body>

</html>

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部