建议使用在手机网站上
pc网站会有兼容问题
css代码
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
html {
font-size: 5.3333vw;
}
* {
padding: 0;
margin: 0;
list-style: none;
font-size: 0.6340rem;
}
.box1 {
width: 18.7504rem;
background-color: mediumvioletred;
height: 18.7504rem;
}
</style>
</head>
<body>
<div class="box1">有一个姑娘,她有一些任性,她还有一些嚣张。</div>
</body>
</html>
rem 计算公式 一定要保留4位小数点
像素宽度 * 比率 = rem对应值
414 * 0.04529106 = 18.7504rem
12像素 0.5434
14像素 0.6340
16像素 0.7246