<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>rem设计</title>
<script type="text/javascript">
document.querySelector('html').style.fontSize=window.screen.width / 20 +'px';
// 针对PC端的切换屏幕大小设置的
window.onresize=function(){
document.querySelector('html').style.fontSize=window.screen.width / 20 +'px';
}
</script>
<style>
.content{
background-color: hotpink;
width: 5rem;
height: 5rem
}
</style>
</head>
<body>
<div class="content">
</div>
</body>
</html>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!