搜索
博主信息
博文 11
粉丝 0
评论 0
访问量 13097
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
布局方案(双飞翼)2019-07-08
简单的博客
原创
815人浏览过

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>双飞翼布局</title>
    <link rel="stylesheet" href="static/css/style6.css">
</head>
<body>
<!--头部-->
<div class="header">
    <!--头部内容区-->
    <div class="content">
        <ul class="nav">
            <li class="item"><a href="">首页</a></li>
            <li class="item"><a href="">公司简介</a></li>
            <li class="item"><a href="">新闻</a></li>
            <li class="item"><a href="">最新产品</a></li>
            <li class="item"><a href="">联系我们</a></li>
        </ul>
    </div>
</div>
        <!--内容区-->
    <div class="container">
        <!--优先渲染主体中间区块-->
        <div class="wrap">
            <div class="main">主体</div>
        </div>
        <div class="left">左侧</div>
        <div class="right">右侧</div>
    </div>
        <!--底部-->
    <div class="footer">
        <div class="content">
            <p>
                <a href="">© PHP中文网版权所有</a>  | 
                <a href="">0551-65358899</a>  | 
                <a href="">皖ICP备18***333-1</a>
            </p>
        </div>
    </div>
</body>
</html>

实例

.header{
    background-color: gray;
}
.header .content{
    width: 1000px;
    height: 60px;
    background-color: black;
    margin: 0 auto;
}
.header .content .nav{
    margin: 0;
    padding: 0;
}
.header .content .nav .item{
    list-style: none;
 }
.header .content .nav .item a{
    float: left;
    min-width: 80px;
    min-height: 60px;
    line-height: 60px;
    color: white;
    text-decoration: none;
    padding: 0 15px;
}
.header .content .nav .item a:hover{
    background-color: red;
    font-size: 1.1rem;
}
/*将主体部分使用双飞翼布局三列布局*/
/*主体 :宽度100% 并且要浮动*/
/*左边栏 :浮动*/
/*右边栏:浮动*/

.container{
    width: 1000px;
    min-height: 800px;
    margin: 30px auto;
    background-color: lawngreen;
    overflow: hidden;
}
.wrap{
    width: inherit;
    height: 800px;
    background-color: lightcyan;
}
.left{
    width: 200px;
    height: 800px;
    background-color: lightskyblue;
}
.right{
    width: 200px;
    height: 800px;
    background-color: lightcoral;
}
/*全部浮动*/
.wrap,.left,.right{
    float: left;
}
.left{
    margin-left: -100%;
}
.right{
    margin-left: -200px;
 }


.main{
    margin: 0 200px;
}
.footer{
    background-color: gray;
}
.footer .content{
    width: 1000px;
    height: 60px;
    background-color: #444;
    margin: 0 auto;
}
.footer .content p{
    text-align: center;
    line-height: 60px;

}
.footer .content p a{
    color: #eee;
    text-decoration: none;
}
.footer .content a:hover{
    color: white;
}

运行实例 »

点击 "运行实例" 按钮查看在线实例

$Z~4XI~NJ3CQPMDFM3]BMY9.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+教程免费学