当放大屏幕尺寸的时候,字体为啥不会随之放大?
相关代码:
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
font-size: 12px;
color: #5d655b;
}
a {
font-size: 12px;
color: #686868;
text-decoration: none;
-webkit-tap-highlight-color: transparent;
}
[data-dpr="2"] body,
[data-dpr="2"] a,
[data-dpr="2"] input {
font-size: 24px;
}
[data-dpr="3"] body,
[data-dpr="3"] a,
[data-dpr="3"] input {
font-size: 36px;
}
li {
list-style: none;
}
img {
vertical-align: top;
border: none;
width: 100%;
}
html,body{
height: 100%;
width: 100%;
}
.header_container{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 2.5rem;
background-color: rgb(206, 206, 206);
}
.navbar{
display: flex;
height: 100%;
justify-content: space-between;
padding-left: .75rem;
padding-right: .75rem;
}
.left_navbar,
.right_navbar{
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.left_navbar{
width: 6.25rem;
}
.right_navbar{
width: 4.25rem;
}
.download{
width: 100%;
height: 1.75rem;
background-color: rgb(233, 201, 201);
border-radius: 1.25rem;
display: flex;
justify-content: center;
align-items: center;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<header class="header_container">
<div class="navbar">
<div class="left_navbar">
<img src="img/logo.png" alt="logo">
</div>
<div class="right_navbar">
<div class="download">
<a href="###">下载APP</a>
</div>
</div>
</div>
</header>
<script src="js/flexible.js"></script>
</body>
</html>
16
收起
正在回答 回答被采纳积分+1
2回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星