使用bootstrap5创建如下页面 1.模板引用只需写出模板的关键词 2.布局要清楚
时间: 2024-03-19 20:44:06 浏览: 123
初步使用bootstrap快速创建页面
抱歉,我是一个纯文本AI语言模型,无法提供图形界面。但是,我可以给你提供一些使用Bootstrap 5创建该页面的代码示例:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 5 Example</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Logo</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Services</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<div class="container mt-5">
<div class="row">
<div class="col-md-6">
<h1>Welcome to our website</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor consectetur nisl, at efficitur libero pulvinar non. Fusce bibendum sapien vel nunc ullamcorper, vel blandit ex porttitor. Nulla facilisi. Mauris tincidunt libero eget orci imperdiet, vel maximus augue ultricies. Donec dictum sollicitudin arcu, vel auctor felis pretium sed. Vivamus rutrum bibendum lacinia. Quisque hendrerit, augue et ornare efficitur, lorem nunc mattis libero, sit amet bibendum quam massa a libero. Morbi id justo enim. </p>
</div>
<div class="col-md-6">
<img src="https://via.placeholder.com/500x250" alt="Image" class="img-fluid">
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
```
这段代码使用了Bootstrap 5的导航栏(navbar)和栅格系统(grid system)来创建了一个简单的网站首页。你可以根据需要修改内容,例如更改Logo和页面文本,替换图像,添加更多导航链接等。
阅读全文