<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF8">
<meta name="viewport" content="width=devicewidth, initialscale=1.0">
<title>Responsive Web Page</title>
<style>
* {
boxsizing: borderbox;
}
body {
margin: 0;
fontfamily: Arial, sansserif;
}
.header {
backgroundcolor: #f1f1f1;
padding: 20px;
textalign: center;
}
.nav {
display: flex;
justifycontent: spacearound;
backgroundcolor: #333;
}
.nav a {
display: block;
color: white;
textalign: center;
padding: 14px 16px;
textdecoration: none;
}
.nav a:hover {
backgroundcolor: #ddd;
color: black;
}
.main {
display: flex;
flexwrap: wrap;
padding: 0 4px;
}
.column {
flex: 50%;
padding: 5px;
}
.column img {
margintop: 8px;
width: 100%;
padding: 10px;
}
@media screen and (maxwidth: 800px) {
.column {
flex: 50%;
}
}
@media screen and (maxwidth: 600px) {
.column {
flex: 100%;
}
}
</style>
</head>
<body>
<div class="header">
<h1>Responsive Web Page</h1>
</div>
<div class="nav">
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Contact</a>
</div>
<div class="main">
<div class="column">
<img src="https://via.placeholder.com/300x200" alt="Image 1">
<img src="https://via.placeholder.com/300x200" alt="Image 2">
</div>
<div class="column">
<img src="https://via.placeholder.com/300x200" alt="Image 3">
<img src="https://via.placeholder.com/300x200" alt="Image 4">
</div>
</div>
</body>
</html>
(图片来源网络,侵删)