感觉很松弛:用CSS写了一个简单的DEMO
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>苹果13 Pro Max 布局</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-color: #f4f4f4;
}
.container {
width: 100%;
max-width: 428px; /* 苹果13 Pro Max 宽度 */
margin: 0 auto;
padding: 20px;
}
.header {
background-color: #ffffff;
border-radius: 12px;
padding: 15px;
margin-bottom: 15px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.content-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
}
.content-item {
background-color: #ffffff;
border-radius: 12px;
padding: 20px;
text-align: center;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.footer {
margin-top: 15px;
background-color: #ffffff;
border-radius: 12px;
padding: 15px;
text-align: center;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
@media screen and (max-width: 428px) {
.container {
width: 100%;
padding: 10px;
}
.content-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>苹果13 Pro Max 布局</h1>
</div>
<div class="content-grid">
<div class="content-item">
<h2>Item 1</h2>
<p>内容区域</p>
</div>
<div class="content-item">
<h2>Item 2</h2>
<p>内容区域</p>
</div>
</div>
<div class="footer">
<p>底部区域</p>
</div>
</div>
</body>
</html>
适配苹果设计风格
grid布局我还不太熟悉,改天研究一下
页:
[1]