使用CSS+HTML完成导航栏
html源码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>导航栏</title>
<style>
/* 导航栏属性 */
.navbar {
background-color: #001f33;
border-radius: 15px;
display: flex;
justify-content: space-around;
box-shadow: 10px 10px 5px rgba(0, 0, 0, 0.5);
}
/* 导航栏中按钮的属性 */
.navbar button {
background-color: #001f33;
color: #fff;
font-size: 20px;
font-weight:bold;
border: none;
padding: 15px 10px;
text-shadow: 4px 5px 4px rgb(255, 255, 255, 0.5);
}
/* 按钮的鼠标悬停效果 */
.navbar button:hover {
background-color: #660202;
}
</style>
</head>
<body>
<div class="navbar">
<div>
<button>游戏1</button>
<button>游戏2</button>
<button>游戏3</button>
<button>游戏4</button>
<button>游戏5</button>
<button>游戏6</button>
<button>游戏7</button>
<button>游戏8</button>
<button>游戏9</button>
</div>
</div>
</body>
</html>
效果: