使用bootstrap制作一个简单的产品介绍的实例网站
时间: 2024-03-24 13:37:24 浏览: 63
使用Bootstrap框架制作查询页面的界面实例代码
好的,以下是使用Bootstrap制作一个简单的产品介绍的实例网站的步骤:
1. 创建HTML文件并链接Bootstrap库
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>产品介绍</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
</body>
</html>
```
2. 创建导航栏
```html
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<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">
<li class="nav-item active">
<a class="nav-link" href="#">首页 <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">产品介绍</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">联系我们</a>
</li>
</ul>
</div>
</nav>
```
3. 创建产品介绍的主体部分
```html
<div class="container mt-5">
<div class="row">
<div class="col-md-6">
<img src="https://via.placeholder.com/600x400" class="img-fluid" alt="">
</div>
<div class="col-md-6">
<h3>产品介绍</h3>
<p>这里是产品介绍的文字内容,可以根据实际情况进行修改。</p>
<ul>
<li>产品特点一</li>
<li>产品特点二</li>
<li>产品特点三</li>
</ul>
<button type="button" class="btn btn-primary">立即购买</button>
</div>
</div>
</div>
```
4. 创建底部信息
```html
<footer class="bg-light text-center mt-5">
<p>版权所有 © 2021 产品名称</p>
</footer>
```
完整代码:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>产品介绍</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<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">
<li class="nav-item active">
<a class="nav-link" href="#">首页 <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">产品介绍</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">联系我们</a>
</li>
</ul>
</div>
</nav>
<div class="container mt-5">
<div class="row">
<div class="col-md-6">
<img src="https://via.placeholder.com/600x400" class="img-fluid" alt="">
</div>
<div class="col-md-6">
<h3>产品介绍</h3>
<p>这里是产品介绍的文字内容,可以根据实际情况进行修改。</p>
<ul>
<li>产品特点一</li>
<li>产品特点二</li>
<li>产品特点三</li>
</ul>
<button type="button" class="btn btn-primary">立即购买</button>
</div>
</div>
</div>
<footer class="bg-light text-center mt-5">
<p>版权所有 © 2021 产品名称</p>
</footer>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</body>
</html>
```
以上就是使用Bootstrap制作一个简单的产品介绍的实例网站的步骤。
阅读全文