美文网首页
迅雷看看案例

迅雷看看案例

作者: IT颖儿 | 来源:发表于2017-01-25 23:38 被阅读0次

    知识点总结

    position三种形式

    1.静态定位 position:static; (标准流中的元素默认形式,基本不存在)
    2.相对定位 ** position:relative;**(相对于自己定位)
    定位坐标:top|bottom|left|right
    取值为正:往盒子里走;取值为负,网盒子内走
    3.绝对定位 position:absolute;(相对于定位元素)
    定位坐标:top|bottom|left|right
    4.固定定位 position:fixed;(相当于网页窗口)
    问题:在IE6.IE7下不兼容
    定位坐标:top|bottom|left|right

    z-index

    目的:实现盒子的逻辑关系,叠加
    作用: z-index:【数字】; 提高层级

    CSS精灵----雪碧技术

    运用背景图的backfround-position属性
    background-position:水平方向坐标 垂直方向坐标;

    游标

    cursor:pointer; 当鼠标移上时,鼠标变小手

    可见性

    display:none; 完全隐藏,不占位(还有inline|block|inline-block)
    visibility:hidden; 占位隐藏 (或visibility:visible; 占位可见)
    overflow:hidden; (溢出隐藏)
    或overflow-x:hidden; 水平(淘宝首页在用) overflow-y:hidden; 垂直

    列表

    控制列表项目编号/符号的属性:list-style
    list-style-type|list-style-position|list-style-image

    list-style-type:none    取消项目编号/符号   最常用
    list-style-type:disc      小圆点            默认
    list-style-type:square  小方块 
    list-style-type:circle  空心圆 
    
    list-style-position:inside;   项目符号在边框内显示  padding:0;margin:0;
    list-style-position:outside;  项目符号在边框内显示 
    

    通常:不用列表的默认项目编号/符号,通常用背景图,配合padding-left
    完成前面的小点

    迅雷看看案例

    Emmet
    作用:快速书写HTML和CSS,带你飞
    快捷键:ctrl+e或Tab
    常用写法
    1.html:5 + 快捷键 调出html5基本骨架;
    html:xt+ 快捷键 调出xhtml1.0基本骨架
    2.简单元素写法:标签名称(+快捷键)

    img1.png
    3.带类(class)元素的写法:标签名称.类名(+快捷键)
    img2.png
    4.带id元素的写法:标签名称#id(+快捷键)
    img3.png
    5.双种属性下并排书写即可
    6.兄弟级并列元素写法:兄标签+弟标签(+快捷键)
    img4.png
    7.父子级嵌套关系的写法:父标签>子标签(+快捷键)
    img5.png
    8.如果让某个元素重复,可以用*
    img6.png
    9.如果某个数值是递增的,可以用$配合*使用
    img7.png
    注:实际开发中,不提倡使用*{margin:0;padding:0;},太耗费资源,很多网站均提供了css初始化的功能,如 Yahoo reset css
    写代码过程中的总结

    1.vertical-align:top(最顶)|bottom(最底)|sub(下标)|super(上标)|text-top(父元素顶)|text-bottom(父元素底)|baseline(默认。元素放在父元素基线上)|%(使用"line-height"属性的百分比值来排列此元素,可为负)
    2.调用css样式表:<head></dead>中添加<link rel="stylesheet"
    href="--/--.css">
    3.应用swf动态图片:在对应位置加<embed src="---/---.swf">
    4.提取公共类:例:宽度均为800px,在css中用.w800{width:800px;margin:0 auto}其中margin:0 auto;是集中对齐
    5.盒子宽度的算法:盒子占空间的宽度 = 盒子内容宽度(width) + 左右padding + 左右border + 左右margin
    6 IE6下盒子不能小于13px
    如果一个盒子小于了13px,那么就给它加overflow:hidden;
    7.不透明度:

    标准浏览器下----opacity:0~1;
    IE6|IE7|IE8下:fiter:alpha(opacity:0~100);
    

    8.解决在IE6下有双倍边距的问题:把他们转化成行内元素,也就是说
    在float:left;或float:right的后面,添加display:inline;

    注意:不要给ol和ul加display:inline;

    9.如果行内元素右浮动,而且它是最后一个元素,那么它在低版本IE下会在下一行显示
    解决方案:1. 将该元素放在第一个的位置;2. 不用浮动,改用绝对定位
    10.禁止文字换行:white-space:nowrap;
    11.代码:text-align:right;展开的快捷代码:ta:r
    代码:text-align:center;展开的快捷代码:ta:c
    代码:text-align:left;;展开的快捷代码:ta:l
    代码:background-color:;展开的快捷代码:bgc

    迅雷看看代码

    HTML

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>迅雷看看</title>
        <link rel="stylesheet" href="css1/base1.css">
        <link rel="stylesheet" href="css1/index1.css">
    </head>
    <body>
    <!--第一部分 stsrt-->
    <div class=" w970 header">
        <!--分成三个部分,用了三个div-->
            <div class="logo fl">
                <embed src="images1/logo.swf"/ ><!--错误:未加/-->
            </div>
            <div class="center fl">
                <form action="">
                    <input type="text" name="q" value="金陵十三钗" class="q"/>
                    <input type="submit" value="搜 索" class="p"/>
                </form>
                <p>
                    <a href="">热播榜</a> 
                    <a href="">乡爱5结局</a>
                    <a href="">我的老爹</a>
                    <a href="">小姨多鹤</a>
                    <a href="">欧阳德</a>
                    <a href="">龙门飞甲</a>
                    <a href="">大冲锋</a>
                </p>
            </div>
            <div class="signed fl">
                <a href="">登陆</a>
                |
                <a href="">注册</a>
                |
                <a href="">迅雷会员</a>
                |
                <a href="" class="sub">订阅</a><br><!--错误:写成/br,导致整个都显示不出来-->
                <a href="">会员专区</a>
                |
                <a href="">移动产品</a>
                |
                <a href="">游戏</a>
                |
                <a href="">帮助</a>
            </div>
        </div>  
    <!--第一部分结束 end-->
    
    <!--第二部分开始 start-->
    <div class="nav w968"><!--错误:w968未写入""内-->
        <ul class="main-nav fl"><!--错误:fl未写入""中-->
            <li  class="cur"><a href="">首页</a></li>
            <li><a href="">电影</a></li>
            <li><a href="">电视剧</a></li>
            <li><a href="">综艺</a></li>
            <li><a href="">动漫</a></li>
            <li><a href="">纪录片</a></li>
            <li><a href="">视频快报</a></li>
            <li><a href="">娱乐</a></li>
            <li><a href="">电视台</a></li>
        </ul>
        <ul class="sub-nav fl">
            <li><a href="">欧美大片</a></li>
            <li><a href="">经典大片</a></li>
            <li><a href="">华语大片</a>![](images1/new.png)</li>
        </ul>
        <ul class="user-nav fl">
            <li>我看过的<s></s></li>
            <li>下载迅雷<s></s></li>
        </ul>
    </div>
    <!--第二部分结束 end-->
    
    <!--第三部分、主体部分 start-->
    <div class="main w970">
        <div class="banner fl">
        <div>
            <a href="">![](images1/main/big1.jpg)</a>
            <p>“赵家班”首部悲情大戏《樱桃》开播 沈春阳挑战傻娘角色 宋小宝颠覆化身“悲情男”(更新至08集)</p>
        </div>
            <ul>
                <li class="cur">![](images1/main/small1.jpg)</li>
                <li>![](images1/main/small2.jpg)</li>
                <li>![](images1/main/small3.jpg)</li>
                <li>![](images1/main/small4.jpg)</li>
                <li>![](images1/main/small5.jpg)</li>
                <li>![](images1/main/small6.jpg)</li>
                <li>![](images1/main/small7.jpg)</li>
                <li>![](images1/main/small8.jpg)</li>
                <li>![](images1/main/small9.jpg)</li>
                <li>![](images1/main/small10.jpg)</li>
                <li>![](images1/main/small11.jpg)</li>
                <li style="margin-right:0">![](images1/main/small12.jpg)</li>
            </ul>
        </div>
        <div class="banner-right fr">
            <ul class="banner-right-nav ">
                <li>全部</li>
                <li class="cur">电影</li>
                <li>电视剧</li>
                <li>综艺</li>
                <li>动漫</li>
                <li>记录</li>
            </ul>
            <ol>
                <li><span>01</span><a href="">深宫谍影</a>更新至26集<strong>7.5 <a href="">深宫谍影</a></strong></li>
                <li><span>02</span><a href="">乡村爱情5</a>44集全<strong>7.8<a href="">乡村爱情5</a></strong></li>
                <li><span>03</span><a href="">如意</a>更新至39集<strong>7.3<a href="">如意</a></strong></li>
                <li><span>04</span><a href="">北京爱情故事</a>39集全<strong>8.5<a href="">北京爱情故事</a></strong></li>
                <li><span>05</span><a href="">怪侠欧阳德</a>69集全<strong>9.5<a href="">怪侠欧阳德</a></strong></li>
                <li><span>06</span><a href="">北京爱情故事</a><strong>8.5<a href="">北京爱情故事</a></strong></li>
                <li><span>07</span><a href="">怪侠欧阳德</a><strong>9.5<a href="">怪侠欧阳德</a></strong></li>
                <li><span>08</span><a href="">北京爱情故事</a><strong>8.5<a href="">北京爱情故事</a></strong></li>
                <li><span>09</span><a href="">怪侠欧阳德</a><strong>7.5<a href="">怪侠欧阳德</a></strong></li>
                <li><span>10</span><a href="">北京爱情故事</a><strong>7.5<a href="">北京爱情故事</a></strong></li>
            </ol>
            <ul>
                <li class="banner-right-nav1"></li>
                <li class="banner-right-bottom"></li>
            </ul>
        </div>
    </div>
    <!--第三部分、主体部分 end-->
    </body>
    </html>
    

    CSS

    @charset "utf-8";
    /*公共部分*/
    .w970{
        width: 970px;
        margin: 0 auto;
    }
    .w968{
        width: 968px;
        margin:0 auto;
        border: 1px solid #ddd;
    }
    body{
        font-size: 12px;
        font-family: "宋体";
        color:#aaaaaa;
    }
    a{
        color:#3d3d3d;
        text-decoration: none;
        font-size: 12px;
    }
    a:hover{
        text-decoration: underline;
    }
    /*公共部分结束*/
    /*第一部分 start*/
    .header{
        height: 108px;
    }
    .logo{
        width: 290px;
        height: 108px;
    }
    .logo embed{
        width: 290px;
        height: 108px;
    }
    .center{
        width: 400px;
        height: 88px;
        padding-top: 20px;
    }
    .center form{
        width: 394px;
        height: 27px;
        border: 3px solid #eee;
    }
    .q{
        width: 320px;
        height: 25px;
        line-height: 25px;
        border: 1px solid #babebf;
        border-right: none;/*解决了在IE6.7下的框内字居中问题*/
        font-size:12px;
        outline: none;
        color: #999;
        padding-left: 5px;
        float:left;/*解决了在IE6.7版本下的代码换行问题*/
    }
    .p{
        width:68px;
        height: 27px;
        background: url(../images1/headerpage_02.png);
        border: 0 none;
        color: white;
        font-size: 14px;
        font-weight: bold;
        outline: none;
        float:left;
    }
    .center p{
        padding-top: 9px;
    }
    .center p a{
        font-size: 12px;
        color: #999;
        margin:0 3px;
    }
    .signed{
        width: 280px;
        height: 68px;
        padding-top: 40px;
        text-align: right;
        line-height: 20px;
        color:#ececec;
    }   
    .signed a{
        color: #999;
        font-size: 12px;
    }
    .sub{
        background: url(../images1/dy.png) no-repeat 0 1px;
        padding-left: 15px;
    }
    /*第二部分 start*/
    .nav{
        height: 35px;
        line-height: 35px;
    }
    .nav li{
        float: left;
        display: inline;
    }
    .nav a{
        color: #3d3d3d;
    }
    
    .main-nav li{
        padding: 0 10px;
    }
    .main-nav a{
            font-size: 14px;
    }
    .main-nav a:hover{
        color: #0081cc;
    } 
    .main-nav.cur a{
        color: #0081cc;
        font-weight: bold;
    }
    
    .sub-nav{
        background: url(../images1/subnav_bg.png) no-repeat 0 7px;/*出现问题*/
        margin-left:10px;
    }
    .sub-nav li{
        padding: 0 11px;
        position:relative;  
    }
    .sub-nav img{
        position: absolute;
        top: 0px;
        left:44px;
    }
    
    .user-nav{
        margin-left: 57px;
        color: #666666;
    }
    .user-nav li{
        position:relative;
        margin-right:20px;
    }
    .user-nav s{
        width: 5px;
        height: 3px;
        background:url(../images1/headerpage.png) 0 -64px;
        position:absolute;
        right:-9px;
        top:16px;
        overflow:hidden;
    }
    /*第二部分 end*/
    
    /*第三部分 主体部分 start*/
    .main{
        height: 365px;
        margin-top: 10px;
        background-color: #000000;
        padding:8px 0 7px 0;
    }
    .banner{
        width: 740px;
        height: 365px;
    }
    .banner-right{
        width: 230px;
        height: 365px;
        background: pink;
    }
    
    .banner div {
        width: 740px;
        height: 310px;
        margin-bottom: 8px;
        position: relative;
    }
    .banner div a{
        font-size: 14px;
    }
    .banner div img{
        width: 740px;
        height: 310px;
    }
    .banner div p{
        width: 740px;
        height: 33px;
        line-height: 33px;
        position:absolute;
        left:0px;
        bottom: 0px;/*错误:把bottom写成right,导致文字始终在图片下方*/
        background-color: #000;
        font-size: 14px;
        color: #fff;
        text-indent:15px;
        opacity: 0.5;
        filter:alpha (opacity:50);
    }
    .banner ul{
    }
    .banner ul li{
        width: 56px;
        height: 45px;
        float:left;
        display:inline;
        background: url(../images1/rank.png) -228px -51px;
        cursor: pointer;
        padding:1px;
        margin-right: 4px;
    }
    .banner ul img{
        width:56px;
        height: 45px;
    }
    .banner li.cur{
        padding-top: 5px;
        margin-top: -4px;
        background-position: -228px 0px;
    }
    
    .banner-right {
        width: 218px;
        height: 353px;
        border: 1px solid #393939;
        background: url(../images1/rank.png);
        font-size: 12px;
        padding: 10px 5px 0;/*顺序:上、左右、下*/
    
    }
    .banner-right-nav {
        width: 210px;
        height: 21px;
        border-left: 1px solid #545454;
        border-top: 1px solid #545454;
        margin:0 auto;
    }
    /*第三部分 主体部分 end*/
    

    相关文章

      网友评论

          本文标题:迅雷看看案例

          本文链接:https://www.haomeiwen.com/subject/dbdzbttx.html