请选择 进入手机版 | 继续访问电脑版
查看: 122|回复: 0

【Bootstrap】快速使用Bootstrap打造的门户网站首页

[复制链接]

699

主题

740

帖子

5974

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5974
发表于 2018-8-28 12:44:22 | 显示全部楼层 |阅读模式
下面是实现的效果图:
00.jpg


具体的网站源码如下:
[JavaScript] 纯文本查看 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--引入bootstrap相关的文件-->
    <!--bootstrap核心css文件-->
    <link rel="stylesheet" href="css/bootstrap.css">

    <!--jQuery核心文件-->
    <script src="js/jquery-1.11.1.min.js" type="text/javascript"></script>

    <!--bootstrap的核心js文件, bootstrap 是依赖于JQuery的-->
    <script src="js/bootstrap.js" type="text/javascript"></script>
    <!--手机端可以缩放网页-->
    <meta name="viewport" content="width=device-width, initial-scale=1">


</head>
<body>
<!--最外层的布局容器-->
<div class="container">
    <!--logo start-->
    <div class="row">
        <div class="col-md-4 col-sm-6">
            <h1 style="color: #e77e2f">我爱科技论坛</h1>
        </div>
        <!--在平板、手机状态下面隐藏这个图标-->
        <div class="col-md-4 hidden-sm hidden-xs">
            <img src="images/header.png" alt="">
        </div>
        <div class="col-md-4 col-sm-6 col-xs-6" style="line-height: 50px; height: 50px;">
            <a href="#">登录</a>
            <a href="#">注册</a>
            <a href="#">购物车</a>
        </div>
    </div>
    <!--logo end-->

    <!--nav start-->
    <div class="row">
        <nav class="navbar navbar-default">
            <div class="container-fluid">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                            data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">首页</a>
                </div>

                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="#">数码 <span class="sr-only">(current)</span></a></li>
                        <li><a href="#">手机数码</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li role="separator" class="divider"></li>
                                <li><a href="#">Separated link</a></li>
                                <li role="separator" class="divider"></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
                    </ul>
                    <form class="navbar-form navbar-right">
                        <div class="form-group">
                            <input type="text" class="form-control" placeholder="Search">
                        </div>
                        <button type="submit" class="btn btn-default">Submit</button>
                    </form>

                </div><!-- /.navbar-collapse -->
            </div><!-- /.container-fluid -->
        </nav>
    </div>
    <!--nav end-->

    <!--slider start-->
    <div class="row">
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <!-- Indicators -->
            <ol class="carousel-indicators">
                <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                <li data-target="#carousel-example-generic" data-slide-to="2"></li>
            </ol>

            <!-- Wrapper for slides -->
            <div class="carousel-inner" role="listbox">
                <div class="item active">
                    <img src="images/1.jpg" alt="...">
                    <div class="carousel-caption">
                        ...
                    </div>
                </div>
                <div class="item">
                    <img src="images/2.jpg" alt="...">
                    <div class="carousel-caption">
                        ...
                    </div>
                </div>
                <div class="item">
                    <img src="images/3.jpg" alt="...">
                    <div class="carousel-caption">
                        ...
                    </div>
                </div>
            </div>

            <!-- Controls -->
            <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </div>
    <!--slider end-->


    <!--banner start-->
    <div class="row">
        <div class="col-md-12">
            <h3>最新商品<img src="images/title2.jpg"></h3>
        </div>
    </div>
    <!--banner end-->


    <!--main start-->
    <div class="row">
        <!--left 大图部分-->
        <!--这张图片在平板和手机状态都隐藏-->
        <div class="col-md-2 hidden-xs hidden-sm" style="height: 480px;">
            <img src="images/products/hao/big01.jpg" alt="">
        </div>
        <!--right 商品-->
        <div class="col-md-10">
            <!--上面的大图片-->
            <div class="col-md-6 hidden-xs hidden-sm" style="height: 240px;">
                <img src="images/products/hao/middle01.jpg" alt="">
            </div>

            <!--高压锅-->
            <!--平板上面显示4个-->
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2  col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>

            </div>
        </div>
        <!--main end-->

    </div>
    <!--main end-->

    <!--add start-->
    <div class="row">
        <!--ad start   -->
        <div class="col-md-12">
            <!--宽度为父容器的宽度, 默认会继承-->
            <img src="images/products/hao/ad.jpg" alt="" style="width: 100%">
        </div>
        <!--ad end-->
    </div>
    <!--add end-->

    <!--others start-->
    <div class="row">
        <!--left 大图部分-->
        <!--这张图片在平板和手机状态都隐藏-->
        <div class="col-md-2 hidden-xs hidden-sm" style="height: 480px;">
            <img src="images/products/hao/big01.jpg" alt="">
        </div>
        <!--right 商品-->
        <div class="col-md-10">
            <!--上面的大图片-->
            <div class="col-md-6 hidden-xs hidden-sm" style="height: 240px;">
                <img src="images/products/hao/middle01.jpg" alt="">
            </div>

            <!--高压锅-->
            <!--平板上面显示4个-->
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2  col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6" style="text-align: center; height: 240px;">
                <img src="images/products/hao/small09.jpg" alt="">
                <p>微波炉</p>
                <p style="color: red;">$998</p>

            </div>
        </div>
        <!--main end-->

    </div>
    <!--others end-->


    <!--footer start-->
    <div class="row">
        <div class="col-md-12">
            <img src="images/footer.jpg" alt="" style="width: 100%;">
        </div>

        <div style="text-align: center">
            <a href="#">关于我们</a>
            <a href="#">关于我们</a>
            <a href="#">关于我们</a>
            <a href="#">关于我们</a>
            <a href="#">关于我们</a>
            <a href="#">关于我们</a>
            <a href="#">关于我们</a>
            <a href="#">关于我们</a>
            <br/>
            Copyright @ 2010-2018 版权所有
        </div>
    </div>
    <!--footer end-->
</div>
</body>
</html>





上一篇:Windows .Net程序超强反编译Reflector工具(可查看程序详细源码)
下一篇:传智播客黑马web前端1期+14期+36期+全栈开发工程师视频jiaoc
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案; 如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子分类或者标题加上【已解决】。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

微信扫一扫

我爱科技论坛(www.52tech.tech)旨在打造全网最大的免费资源共享平台。目前论坛包括考研资料、编程学习、黑科技/科学上网、开源软件等资源模块,竭力服务于正在学习道路上的每一个人。我爱科技论坛,爱科技,更爱分享。致力于营造一个资源丰富、内容完善的大型网络学习交流资源共享平台!

QQ|Archiver|手机版|小黑屋|我爱科技论坛 快乐学习交流

(请勿发布违反中华人民共和国法律法规的言论,会员观点不代表我爱科技论坛的官方立场)

Powered by Discuz! X3.4© 2001-2013 Technology Inc.

返回顶部 返回列表