很好的主意!以下是一个简单的游戏网站的示例代码。

HTML代码:

<!DOCTYPE html>
<html>
<head>
	<title>简约游戏</title>
	<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
	<header>
		<h1>简约游戏</h1>
	</header>
	<nav>
		<ul>
			<li><a href="#">游戏1</a></li>
			<li><a href="#">游戏2</a></li>
			<li><a href="#">游戏3</a></li>
		</ul>
	</nav>
	<main>
		<section>
			<h2>游戏1</h2>
			<p>这里可以写游戏1的介绍。</p>
			<a href="#" class="play-button">开始游戏</a>
		</section>
		<section>
			<h2>游戏2</h2>
			<p>这里可以写游戏2的介绍。</p>
			<a href="#" class="play-button">开始游戏</a>
		</section>
		<section>
			<h2>游戏3</h2>
			<p>这里可以写游戏3的介绍。</p>
			<a href="#" class="play-button">开始游戏</a>
		</section>
	</main>
	<footer>
		<p>&copy; 2021 简约游戏</p>
	</footer>
</body>
</html>

CSS代码:

body {
	margin: 0;
	padding: 0;
	font-family: Arial, sans-serif;
}

header {
	background-color: #333;
	color: #fff;
	padding: 20px;
	text-align: center;
}

nav {
	background-color: #eee;
	padding: 10px;
}

nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	justify-content: center;
}

nav li {
	margin: 0 10px;
}

nav a {
	text-decoration: none;
	color: #333;
	font-weight: bold;
	font-size: 18px;
}

nav a:hover {
	color: #666;
}

main {
	padding: 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

section {
	background-color: #eee;
	padding: 20px;
	margin: 20px;
	text-align: center;
	flex-basis: 300px;
}

section h2 {
	margin-top: 0;
}

.play-button {
	display: inline-block;
	padding: 10px 20px;
	background-color: #333;
	color: #fff;
	text-decoration: none;
	margin-top: 20px;
	border-radius: 5px;
}

.play-button:hover {
	background-color: #666;
}

footer {
	background-color: #333;
	color: #fff;
	padding: 10px;
	text-align: center;
}

这个网站包含一个标题,导航栏,三个游戏节,以及一个页脚。每个游戏节包含一个标题,一段介绍,和一个开始游戏按钮。CSS代码使网站看起来干净和现代

做一个简约的游戏html网站

原文地址: https://www.cveoy.top/t/topic/coFn 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录