少儿编程网站首页用bootstrap书写源代码
时间: 2024-10-25 12:16:52 浏览: 7
少儿编程网站首页使用Bootstrap书写源代码通常会包含以下几个部分:
```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>少儿编程</title>
<!-- 引入Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css">
<style> /* 自定义样式 */ </style>
</head>
<body>
<header class="navbar navbar-expand-md bg-primary text-white">
<!-- 导航栏内容 -->
<nav class="container">
<a class="navbar-brand" href="#">少儿编程网</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#">首页</a></li>
<li class="nav-item"><a class="nav-link" href="#">课程</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
资源
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">教程</a>
<a class="dropdown-item" href="#">案例</a>
</div>
</li>
</ul>
</div>
</nav>
</header>
<!-- 主体内容区域 -->
<main class="container mt-5">
<!-- 内容填充如轮播图、课程推荐等 -->
</main>
<!-- Bootstrap JS引用 -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script>
</body>
</html>
```
阅读全文