温馨提示×

bootstrap经典网页布局

发布时间:2022-02-23 10:30:19 阅读:162 作者:小新 栏目:开发技术

小编给大家分享一下bootstrap经典网页布局,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

HTML代码

<div class="logo">
    logo
</div>
<div class="container-fluid">    
    <div class="row main">
        <div class="col-md-3 nav">nav</div>
        <div class="col-md-9 content">
            <div class="content-body">content</div>
        </div>
    </div>
</div>

CSS样式

  • 代码分为格式化代码(用于清除不同浏览器兼容性问题)

  • 布局代码(用于界面布局的代码)

<style>
        /*淘宝CSS格式化代码*/
        body,
        h2h3h4h5h6h7hrpblockquotedldtddulollipreformfieldsetlegendbuttoninputtextareathtd {
            margin0;
            padding0;
        }
        bodybuttoninputselecttextarea {
            font12px/1.5 tahoma, arial, \5b8b\4f53;
        }
        h2h3h4h5h6h7 {
            font-size100%;
        }
        addresscitedfnemvar {
            font-style: normal;
        }
        codekbdpresamp {
            font-family: couriernew, courier, monospace;
        }
        small {
            font-size12px;
        }
        ulol {
            list-style: none;
        }
        a {
            text-decoration: none;
        }
        a:hover {
            text-decoration: underline;
        }
        sup {
            vertical-align: text-top;
        }
        sub {
            vertical-align: text-bottom;
        }
        legend {
            color#000;
        }
        fieldsetimg {
            border0;
        }
        buttoninputselecttextarea {
            font-size100%;
        }
        table {
            border-collapse: collapse;
            border-spacing0;
        }
        /*布局CSS代码*/
        bodyhtml {
            background#EAEEF2;
            width100%;
            height100%;
            color: lightblue;
        }
        .container-fluid {
            background: aquamarine;
            height100%;
        }
        .logo {
            background: black;
            font-size40px;
            padding-left20px;
            height60px;
            min-height60px;
            width100%;
            position: fixed;
            top0;
            right0;
            z-index100;
        }
        .nav {
            background: white;
            font-size30px;
            height100%;
            width15%;
            float: left;
            position: relative;
            margin-right: -100%;
            box-shadow0px 2px 3px 2px rgba(0000.1);
        }
        .content {
            height100%;
            width85%;
            margin-left15%;
        }
        .content-body {
            padding-left15px;
            padding-right15px;
            background: white;
            height100%;
            font-size300px;
            box-shadow0px 0px 10px rgba(0000.3);
            overflow: auto;
        }
        .main {
            background#F8F8F8;
            height100%;
            padding-top68px;
            padding-bottom6px;
        }
    </style>

以上是“bootstrap经典网页布局”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

温馨提示×

网络异常,请检查网络