手机适配:重要通知 - 易联AI 数据库恢复中
为了在手机上适配显示,您可以通过使用响应式设计和媒体查询来调整页面元素的大小和布局。以下代码示例经过调整尺寸,可以在手机上适配显示:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>重要通知!!!</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
width: 90%;
max-width: 400px;
margin: 100px auto;
padding: 20px;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 5px #ccc;
}
h1 {
text-align: center;
color: #333;
margin-bottom: 10px;
}
p {
text-align: center;
color: #666;
margin-top: 0;
}
.wechat {
text-align: center;
margin-top: 20px;
}
.wechat img {
width: 100%;
max-width: 200px;
height: auto;
border-radius: 5px;
box-shadow: 0 0 5px #ccc;
}
.contact-info {
text-align: center;
margin-top: 20px;
font-size: 16px;
}
</style>
</head>
<body>
<div class="container">
<h1>易联AI</h1>
<p>数据库被删除了!正在紧急处理!!请各位先加客服微信,稍安勿躁!</p>
<div class="wechat">
<img src="cao.png" alt="微信二维码">
</div>
<div class="contact-info">
<p>微信:wx2481022</p>
</div>
</div>
</body>
</html>
在这个版本中,我使用了width=device-width, initial-scale=1.0的 meta 标签来确保页面在手机上正确缩放。另外,我通过设置 .container 的宽度为 90% 并添加了 max-width: 400px,使得容器在手机上有适当的宽度。微信二维码的宽度也被限制在 200px 内,以适应手机屏幕。
请注意将 cao.png 替换为你的微信二维码图片的路径。如果你对页面有其他需求,请随时告诉我!
原文地址: https://www.cveoy.top/t/topic/Rm1 著作权归作者所有。请勿转载和采集!