zoukankan      html  css  js  c++  java
  • Html5 学习笔记 【PC固定布局】 实战5 咨询页面 侧栏

    最终效果图:

    提出公共页脚和导航部分:

    新建infomatino.html (旅游咨询)页面

    <!DOCTYPE html>
    <html lang="zh-cn">
    <head>
        <meta charset="UTF-8">
        <title>项目实战 PC端固定布局</title>
        <link rel="stylesheet" href="css/basic.css">
        <link rel="stylesheet" href="css/column.css">
    </head>
    <body>
        <!-- 导航了部分 -->
        <!-- body nav section 需要h1~h6标题大纲 div header不需要  -->
        <header id="header">
            <div class="center">
                <!-- 一个页面最好就一个h1 让搜索引擎能更好的抓取关键字 -->
                <h1 class="logo">旅行社</h1>
                <nav class="link">
                    <h2 class="none">网站导航</h2>
                    <ul>
                        <li><a href="index.html">首页</a></li>
                        <li class="active"><a href="infomation.html">旅游咨询</a></li>
                        <li><a href="###">机票订购</a></li>
                        <li><a href="###">风景欣赏</a></li>
                        <li><a href="###">公司简介</a></li>
                    </ul>
                </nav>
            </div>
        </header>
        
        <div id="headline">
            <div class="center">
                <hgroup>
                    <h2>旅游咨询</h2>
                    <h3>介绍各种最新的旅游信息,咨询要问,景点攻略</h3>
                </hgroup>
            </div>
        </div>
    
        <div id="container">
            <aside class="sidebar">
                <div class="sidebox recommend">
                    <h2>景点推荐</h2>
                    <div class="tag">
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                        <a href="###">曼谷(12)</a>
                    </div>
                </div>
                <div class="sidebox hot">
                    <h2>热门旅游</h2>
                    <figure class="figure">
                        <img src="img/hot1.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure> 
                    <figure class="figure">
                        <img src="img/hot2.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure>
                    <figure class="figure">
                        <img src="img/hot3.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure> 
                    <figure class="figure">
                        <img src="img/hot4.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure>
                    <figure class="figure">
                        <img src="img/hot5.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure> 
                    <figure class="figure">
                        <img src="img/hot6.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure>
                    <figure class="figure">
                        <img src="img/hot7.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure> 
                    <figure class="figure">
                        <img src="img/hot8.jpg" alt="曼谷芭提雅6日游">
                        <figcaption>曼谷芭提雅6日游</figcaption>
                    </figure>
                </div>
                <div class="sidebox treasure">
                    <h2>旅游百宝箱</h2>
                    <div class="box">
                        <a href="###" class="trea1">天气预报</a>
                        <a href="###" class="trea2">火车票查询</a>
                        <a href="###" class="trea3">航空查询</a>
                        <a href="###" class="trea4">地铁线路查询</a>
                    </div>
                </div>
            </aside>
            <div class="list">
                list
            </div>
        </div>
    
        <!-- 页脚部分 -->
        <footer id="footer">
            <div class="top">
                <div class="block left">
                    <h2>合作伙伴</h2>
                    <!-- 水平线 -->
                    <hr>
                    <ul>
                        <li>途牛旅游网</li>
                        <li>驴妈妈旅游网</li>
                        <li>携程旅游网</li>
                        <li>去哪旅游网</li>
                    </ul>
                </div>
                <div class="block center">
                    <h2>旅游咨询QA</h2>
                    <!-- 水平线 -->
                    <hr>
                    <ul>
                        <li>旅游合同签订方式</li>
                        <li>儿童机票价格</li>
                        <li>旅游线路定制</li>
                        <li>单房差是什么</li>
                        <li>旅游保险种类</li>
                    </ul>
                </div>
                <div class="block right">
                    <h2>联系方式</h2>
                    <!-- 水平线 -->
                    <hr>
                    <ul>
                        <li>微博:weibo.com/lvyou</li>
                        <li>邮件:lvyou@lvyou.com</li>
                        <li>地址:沈阳铁西金桂路123号</li>
                    </ul>
                </div>
            </div>
            <div class="bottom">
                Copyright© jjjj | ICP 备 131313312112号 | 旅行社经营许可证 : L-YC-BB12313212 
            </div>
        </footer>
        
    </body>
    </html>

    页面column.css 内容:

    @charset "utf-8";
    
    /*-------------------------------咨询页面 侧栏主页---------------------------------------*/
    #headline {
        width: 100%;
        /*缩小页面滚动条右侧出现白色区域*/
        min-width: 1263px;
        height: 300px;
        /*渐变 方位 颜色 透明度 rgba */
        /*向右下方 黑色渐变 透明度0.7 - 全透明*/
        background: linear-gradient(to right bottom, rgba(0,0,0,0.7), rgba(0,0,0,0)), url(../img/headline.jpg) no-repeat center;
    }
    
    #headline .center {
        width: 1263px;
        height: 300px;
        margin: 0 auto;
    }
    
    #headline hgroup {
        padding: 100px 0 0 50px;
    }
    
    #headline h2 {
        color: #eee;
        font-size: 36px;
        letter-spacing: 1px;
    }
    
    #headline h3 {
        color: #eee;
        font-size: 20px;
        letter-spacing: 1px;
    }
    
    #container {
        width: 1263px;
        margin: 30px auto;
    }
    
    #container .sidebar {
        width: 340px;
        /*background-color: #eee;*/
        float: right;
    }
    
    #container .sidebox {
        border: 1px solid #eee;
        /*下面的边距10px 上右下左*/
        margin: 0 0 10px 0;
        text-align: center;
    }
    
    #container .sidebox h2 {
        font-size: 20px;
        font-weight: normal;
        letter-spacing: 1px;
        /*首行缩进*/
        text-indent: 8px;
        height: 40px;
        line-height: 40px;
        background-color: #fafafa
        color: #666;
        text-align: left;
    }
    
    #container .tag {
        margin: 10px 0;
    }
    
    #container .tag a {
        background-color: #eee;
        display: inline-block;
        width: 100px;
        height: 35px;
        line-height: 35px;
        margin: 2px 0;
        color: #999;
    }
    
    #container .tag a:hover {
        background-color: #458b00;
        color: white;
    }
    
    #container .figure {
        padding: 10px 0;
    }
    
    #container figure {
        display: inline-block;
        padding: 4px;
        color: #666;
    }
    
    #container .box {
        margin: 10px 0;
    }
    
    #container .box a {
        background-color: #eee;
        display: inline-block;
        width: 157px;
        height: 40px;
        line-height: 40px;
        margin: 2px 0;
        color: #999;
    }
    
    #container .box a:hover {
        color: green;
    }
    
    /*旅游百宝箱背景图片*/
    #container .box a.trea1 {
        background: #eee url(../img/trea1.png) no-repeat 10px center;
    }
    #container .box a.trea2 {
        background: #eee url(../img/trea2.png) no-repeat 10px center;
    }
    #container .box a.trea3 {
        background: #eee url(../img/trea3.png) no-repeat 10px center;
    }
    #container .box a.trea4 {
        background: #eee url(../img/trea4.png) no-repeat 10px center;
    }
    
    #container .list {
        width: 900px;
        /*background-color: #ccc;*/
        float: left;
    }

    抽取基础css文件内容 basic.css:

    @charset "utf-8";
    
    /*------------------------------------第一节 导航栏部分------------------------------------*/
    /*本身外边距*/
    body, h1, ul, h2, p, figure, h3{
        margin: 0;
        padding: 0;
    }
    
    ul {
        list-style: outside none none;
    }
    
    /* a 标签不需要下划线 */
    a {
        text-decoration: none;
    }
    
    .none {
        display: none;
    }
    
    #header {
        width: 100%;
        min-width: 1263px;
        height: 70px;
        background: #333;
        /*header做个阴影*/
        box-shadow: 0 5px 10px rgba(0,0,0,0.3);
        position: relative;
        z-index: 9999;
    }
    
    #header .center {
        width: 1263px;
        height: 70px;
        margin: 0 auto;
    }
    
    #header .logo {
        width: 240px;
        height: 70px;
        background-image: url(../img/logo.png);
        /* h1中的字向左移动到不能看到 */
        text-indent: -9999px;
        float: left;
    }
    
    #header .link {
        width: 650px;
        height: 70px;
        float: right;
        /* 字体淡灰 */
        color: #eee;
        /* 文字垂直居中 设定高度和 ul高度相同即可 */
        line-height: 70px;
    }
    
    #header .link li {
        width: 120px;
        /* li 文字横向铺平 */
        float: left;
        text-align: center;
    }
    
    #header .link a {
        color: #eee;
        display: block;
    }
    
    #header .link a:hover,
    #header .active a {
        background-color: #000;
    }
    
    
    
    #footer {
        min-width: 1263px;
        height: 360px;
        background-color: #222;
        clear: both;
        position: relative;
        top: 20px;
    }
    
    #footer .top {
        width: 1263px;
        height: 280px;
        /*background-color: red;*/
        /*居中水平*/
        margin: 0 auto;
        text-align: center;
    }
    
    /*footer 合作伙伴等信息*/
    #footer .left {
        
    }
    
    #footer .center {
        
    }
    
    #footer .right {
        
    }
    
    #footer .block {
        width: 410px;
        height: 280px;
        /*background-color: green;*/
        display: inline-block;
        text-align: left;
        color: #ccc;
        vertical-align: top;
    }
    
    #footer h2 {
        font-size: 24px;
        font-weight: normal;
        padding: 20px 0 0 20px;
    }
    
    #footer hr {
        width: 90%;
        border: 1px dashed;
    }
    
    #footer ul {
        font-size: 18px;
        color: #777;
        /*文本首行缩进*/
        text-indent: 20px;
        line-height: 2;
    }
    
    /*所有权*/
    #footer .bottom {
        height: 80px;
        color: #777;
        text-align: center;
        line-height: 80px;
        background-color: #000;
        /*距上边框的一条线 好看*/
        border-top: 1px solid #444;
    }

      将style.css basic.css 抽取出来的部分进行删除

  • 相关阅读:
    Flask框架学习教程 汇总篇
    git版本管理工具
    Django-rest framework框架 汇总篇
    数据库学习之路 汇总篇
    Web后端开发学习教程 汇总篇
    Django框架学习教程 汇总篇
    Web前端开发学习教程 汇总篇
    Python开发之爬虫 汇总篇
    Python从入门到放弃 汇总篇
    flask之SQLAlchemy
  • 原文地址:https://www.cnblogs.com/lixuchun/p/9157961.html
Copyright © 2011-2022 走看看