用bootstrap框架制作京东网页
时间: 2024-03-14 09:39:52 浏览: 70
以下是使用Bootstrap框架制作京东网页的示例代码:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>京东网页</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<style>
.fakeimg {
height: 200px;
background: #aaa;
}
.carousel-inner img {
width: 100%;
height: 100%;
}
.product .name {
border-bottom: 1px solid #eee;
}
.product .name h3{
font-weight: 500;
font-size: 20px;
color: #666;
margin-top: 10px;
}
.product .price {
font-size: 22px;
margin: 10px 0;
}
.product .price span{
color: #aaa;
margin-left: 10px;
text-decoration: line-through;
}
</style>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">京东</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">首页</a></li>
<li><a href="#">手机</a></li>
<li><a href="#">电脑</a></li>
<li><a href="#">家电</a></li>
<li><a href="#">运动</a></li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="搜索">
</div>
<button type="submit" class="btn btn-default">提交</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">登录</a></li>
<li><a href="#">注册</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-3">
<h2>分类</h2>
<div class="list-group">
<a href="#" class="list-group-item active">手机</a>
<a href="#" class="list-group-item">电脑</a>
<a href="#" class="list-group-item">家电</a>
<a href="#" class="list-group-item">运动</a>
</div>
</div>
<div class="col-md-9">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="https://img13.360buyimg.com/n1/s450x450_jfs/t1/131064/22/1045/100000/5edf7d3eEa9c8b6d4/7d7d7d7d7d7d7d7d.jpg" alt="手机">
</div>
<div class="item">
<img src="https://img13.360buyimg.com/n1/s450x450_jfs/t1/131064/22/1045/100000/5edf7d3eEa9c8b6d4/7d7d7d7d7d7d7d7d.jpg" alt="电脑">
</div>
<div class="item">
<img src="https://img13.360buyimg.com/n1/s450x450_jfs/t1/131064/22/1045/100000/5edf7d3eEa9c8b6d4/7d7d7d7d7d7d7d7d.jpg" alt="家电">
</div>
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">上一个</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">下一个</span>
</a>
</div>
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<img src="https://img13.360buyimg.com/n1/s450x450_jfs/t1/131064/22/1045/100000/5edf7d3eEa9c8b6d4/7d7d7d7d7d7d7d7d.jpg" alt="手机">
<div class="caption product">
<div class="name">
<h3>小米手机</h3>
</div>
<div class="price">
¥1999.00
<span>¥2999.00</span>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<img src="https://img13.360buyimg.com/n1/s450x450_jfs/t1/131064/22/1045/100000/5edf7d3eEa9c8b6d4/7d7d7d7d7d7d7d7d.jpg" alt="电脑">
<div class="caption product">
<div class="name">
<h3>联想电脑</h3>
</div>
<div class="price">
¥3999.00
<span>¥4999.00</span>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<img src="https://img13.360buyimg.com/n1/s450x450_jfs/t1/131064/22/1045/100000/5edf7d3eEa9c8b6d4/7d7d7d7d7d7d7d7d.jpg" alt="家电">
<div class="caption product">
<div class="name">
<h3>海尔冰箱</h3>
</div>
<div class="price">
¥2999.00
<span>¥3999.00</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
```
阅读全文