1.要求样式
- 导航栏向右展开
- 背景颜色为灰色
- 字体颜色略深
- 鼠标悬停颜色最深
- 鼠标悬停时整个方块都被选中
- 尽量还原w3school的导航栏
2.vscode代码
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>导航</title>
<link rel="stylesheet" href="../重置样式表/reset.css">
<style>
.nav{
width: 1151px;
height: 48px;
background-color: gainsboro;
margin: 100px auto;
}
/* 设置li属性 */
.nav li{
/* 向左浮动 */
float: left;