以我的世界服务器官网为题,写一个排版优美,布局简洁大气,有背景图片和超链接模块的模板代码
时间: 2024-03-23 09:36:30 浏览: 44
以下是一个简单的排版优美、布局简洁大气、有背景图片和超链接模块的模板代码,供参考:
```html
<!DOCTYPE html>
<html>
<head>
<title>我的世界服务器官网</title>
<style>
body {
background-image: url("background.jpg");
background-size: cover;
background-position: center;
font-family: Arial, sans-serif;
color: #fff;
margin: 0;
padding: 0;
}
header {
background-color: rgba(0, 0, 0, 0.5);
padding: 20px;
text-align: center;
}
h1 {
font-size: 36px;
margin: 0;
}
nav {
background-color: rgba(0, 0, 0, 0.5);
padding: 10px;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
}
nav li {
margin: 0 10px;
}
nav a {
color: #fff;
text-decoration: none;
font-size: 24px;
transition: all 0.3s ease-in-out;
}
nav a:hover {
color: #00ff00;
}
main {
padding: 20px;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
min-height: 500px;
}
section {
background-color: rgba(0, 0, 0, 0.5);
padding: 20px;
margin: 20px;
flex-basis: 300px;
min-height: 200px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
section img {
max-width: 100%;
max-height: 100%;
}
section h2 {
font-size: 24px;
margin: 10px 0;
}
section p {
font-size: 18px;
margin: 0;
}
footer {
background-color: rgba(0, 0, 0, 0.5);
padding: 20px;
text-align: center;
}
footer p {
margin: 0;
font-size: 18px;
}
footer a {
color: #fff;
text-decoration: none;
font-size: 18px;
transition: all 0.3s ease-in-out;
}
footer a:hover {
color: #00ff00;
}
</style>
</head>
<body>
<header>
<h1>我的世界服务器官网</h1>
</header>
<nav>
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">论坛</a></li>
<li><a href="#">商店</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</nav>
<main>
<section>
<img src="image1.jpg" alt="图片1">
<h2>标题1</h2>
<p>内容1</p>
</section>
<section>
<img src="image2.jpg" alt="图片2">
<h2>标题2</h2>
<p>内容2</p>
</section>
<section>
<img src="image3.jpg" alt="图片3">
<h2>标题3</h2>
<p>内容3</p>
</section>
</main>
<footer>
<p>版权所有 © 2021 我的世界服务器</p>
<p>网站设计 by <a href="#">你的名字</a></p>
</footer>
</body>
</html>
```
注意:该代码仅供参考,具体根据实际情况进行修改和完善。
阅读全文