案例1:首页轮播图实现
组件:轮播-Carousel
案例一的完成方法首先我们要打开bootstrap的中文文档搜索Carousel找一个合适的复制一下我使用的就是这个接下来展示一下代码(用红色标记的东西是复制)
<div class="row" style="background-color: white;">
<div class="col">
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="3"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img/lb1.png" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="img/lb2.jpg" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="img/lb3.jpg" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="./img/lb4.jpeg" class="d-block w-100" alt="...">
</div>
</div>
<button class="carousel-control-prev" type="button"
data-target="#carouselExampleIndicators" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</button>
<button class="carousel-control-next" type="button"
data-target="#carouselExampleIndicators" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</button>
</div>
</div>
</div>
当然用别人现成的东西合适要学会改一下的上面这个是我改过了的
主要就是该一下img(img主要是路径)标签和ol标签内部的li标签(li标签是根据下标)
案例2:首页书籍分类实现
组件:列表组-List group
案例二的完成方法首先我们要打开bootstrap的中文文档搜索List group
<div class="col-3" style="background-color: white;">
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active" aria-current="true">
图书分类
</a>
<a href="#" class="list-group-item list-group-item-action">言情小说</a>
<a href="#" class="list-group-item list-group-item-action">系统小说</a>
<a href="#" class="list-group-item list-group-item-action">同人小说</a>
<a href="#" class="list-group-item list-group-item-action">同人小说</a>
<a href="#" class="list-group-item list-group-item-action">同人小说</a>
<a href="#" class="list-group-item list-group-item-action">同人小说</a>
<a href="#" class="list-group-item list-group-item-action">同人小说</a>
<a href="#" class="list-group-item list-group-item-action">同人小说</a>
<a class="list-group-item list-group-item-action disabled">妖魔天地</a>
</div>
</div>
案例二的话主要的就是第一个a(标签是和其他a标签颜色不一样的也是可以用来写一个大归类的)
其它的a标签就是写一些小的分类(它这个Links and buttons 是有高亮效果的最后一个了是有一个禁用的如果不想要可以吧disabled选择器删掉)
案例3:首页新书上架&热门书籍实现
页面内容:画像-Figure
案例三的完成方法首先我们要打开bootstrap的中文文档搜索Figure
<div class="col">
<figure class="figure">
<img src="img/1.png" class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption text-right">小小牛马</figcaption>
<img src="img/1.png" class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption text-right">小小牛马</figcaption>
</figure>
</div>
案例三的话主要需要主要一小的是img标签(的路径需要写)还有figcaption标签的开始结束的中间写上对应的img标签的汉字
四.内容总结
总的来说就是一句话拿别人的东西直接用还是要学会在别人的基础上做出一些效果上的修改