博主信息
博文 12
粉丝 0
评论 0
访问量 15327
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
bootstrap 博客式布局
留情的博客
原创
1054人浏览过

bootstrap 布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/bootstrap.css">
    <style>
 .header {
 height: 40px;
        }

        .input-group {
 padding-top: 20px;
        }

        .aside {
 /*background-color: #6666BB;*/
 padding-top: 20px;
        }
        .text-small {
 margin: 0;
 padding: 0;
 /*background-color: #8f5902;*/
 }
 </style>
</head>
<body>
<div class="container ">
    <div class="row">
        <div class="row header">
            <div class="col-md-3">
                <img src="logo.jpg" width="200" alt="">
            </div>
            <div class="col-md-6 col-md-offset-3 form-group">
                <div class="input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
                    <input type="text" class="form-control" id="search" placeholder="搜索......"
 onfocus="this.placeholder=''" onblur="this.placeholder='搜索......'">
                    <span class="input-group-btn">
                    <button class="btn btn-success">搜索</button>
                </span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <ul class="nav nav-tabs ">
                    <li><a href="#">首页</a></li>
                    <li><a href="#">HTML</a></li>
                    <li><a href="#">JavaScript</a></li>
                    <li><a href="#">jQuery</a></li>
                    <li><a href="#">bootstrap</a></li>
                    <li><a href="#">PHP</a></li>
                </ul>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12 aside">
                <div class="col-md-3">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title">
 关于我
 </h3>
                        </div>
                        <div class="panel-body">内容</div>
                    </div>
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title">
 学习记录
 </h3>
                        </div>
                        <div class="panel-body">
                            <ul class="nav nav-tabs nav-stacked">
                                <li class="nav-tabs"><a href="">第一天</a></li>
                                <li class="nav-tabs"><a href="">第二天</a></li>
                                <li class="nav-tabs"><a href="">第三天</a></li>
                                <li class="nav-tabs"><a href="">第四天</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="col-md-9">
                    <ul style="list-style: none">
                        <li>
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">
                                        <a href="">HTML的相关文章或者列表</a>
                                    </h3>
                                </div>
                                <div class="panel-body">
 内容
 <hr>
                                    <div class="col-md-6 text-small">
                                        <div class="col-md-3 text-small">
                                            <a href="">
                                                <span class="glyphicon glyphicon-calendar  "></span>
                                                <small>
                                                    <em>2017.12.23</em>
                                                </small>
                                            </a>
                                        </div>
                                        <div class="col-md-3 text-small"><a href="">
                                            <span class="glyphicon glyphicon-comment"></span>
                                            <small>
                                                <em>3</em>条评论
 </small>
                                        </a></div>
                                        <div class="col-md-3 text-small"><a href="">
                                            <span class="glyphicon glyphicon-eye-open"></span>
                                            <small>
                                                <em>144</em>次阅读
 </small>
                                        </a></div>
                                        <div class="col-md-3 text-small"><a href="">
                                            <span class="glyphicon glyphicon-thumbs-up"></span>
                                            <small>
                                                <em>123</em>次点赞
 </small>
                                        </a></div>
                                    </div>
                                    <div class="col-md-2 col-md-offset-4">
                                        <a href="">
                                            <small>阅读全文</small>
                                            <span class="glyphicon glyphicon-chevron-right "></span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">
                                        <a href="">JavaScript的相关文章或者列表</a>
                                    </h3>
                                </div>
                                <div class="panel-body">内容</div>
                            </div>
                        </li>
                        <li>
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">
                                        <a href="">jQuery的相关文章或者列表</a>
                                    </h3>
                                </div>
                                <div class="panel-body">
 内容
 <hr>
                                    <div class="col-md-2 text-small">
                                        <a href="">
                                            <span class="glyphicon glyphicon-calendar  "></span>
                                            <small>
                                                <em>2017.12.23</em>
                                            </small>
                                        </a>
                                    </div>
                                    <div class="col-md-2 text-small">
                                        <a href="">
                                            <span class="glyphicon glyphicon-comment"></span>
                                            <small>
                                                <em>3</em>条评论
 </small>
                                        </a>
                                    </div>
                                    <div class="col-md-2 text-small">
                                        <a href="">
                                            <span class="glyphicon glyphicon-eye-open"></span>
                                            <small>
                                                <em>144</em>次阅读
 </small>
                                        </a>
                                    </div>
                                    <div class="col-md-2 text-small">
                                        <a href="">
                                            <span class="glyphicon glyphicon-thumbs-up"></span>
                                            <small>
                                                <em>123</em>次点赞
 </small>
                                        </a>
                                    </div>
                                    <div class="col-md-2 col-md-offset-2">
                                        <a href="">
                                            <small>阅读全文</small>
                                            <span class="glyphicon glyphicon-chevron-right "></span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>

input中的placeholder在chorome中获取焦点后不消失,只有输入字符后才消失,所以加了简单的javascript代码来实现

<input type="text" class="form-control" id="search" placeholder="搜索......"
 onfocus="this.placeholder=''" onblur="this.placeholder='搜索......'">

input搜索框前面的图标之所以用了两个span,是为了对齐后面的input输入框。

<span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>


LOGO时随便找的

HTML的相关文章或者列表下的日期评论跟jQuery下面的日期评论用了两种嵌套方法

感兴趣的可以自己把代码复制运行下

QQ图片20171223211005.png

本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学