• 学习笔记之CSS样式(选择器背景字体边框绝/相对、固定位置and分层流等)


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style type="text/css">
    /**代表选取所有元素*/


    #d6{ font-size:14px;
    color:#000;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-weight:bold;
    }

    #d div{color:#3F0;}

    span,div{ text-decoration:underline}
    div.c1{ text-align:center}
    #p1{ 300px;
    height:300px;
    background-color:#303;
    position:fixed;
    right:0px;
    bottom:0px;
    opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);
    box-shadow:100 100 100px #000000;}
    .l2{ float:right;}
    #z1{ 200px; height:50px;
    background-color:#6FC;
    text-align:center;
    vertical-align:middle;
    line-height:60px;}
    .z2{ float:left;
    40px; height:50px;
    background-color:#F09;
    color:#000;}
    </style>

    </head>

    <body>
    <div id="d" style="border:5px solid #F69;">一代二代三代ASDE
    <div>后代一</div>
    <div>后代二</div>
    </div>

    <div><marquee direction="left" style="z-index:+10; position:relative;">滚动效果</marquee></div>
    <div><marquee direction="right" style="z-index:-5; position:relative;"><img src="1.jpg"></marquee></div>

    <hr />
    <span>
    <mark>苹果</mark><!--关键字效果,特殊处理,默认黄色,后期用样式来改-->公司发布了IPONE7,耳机遭到了吐槽
    </span>
    <hr />

    <div id="d8" style="font-size:20px">准确控制</div>

    <div class="c1">第一个</div>
    <div class="c1">第二个</div>
    <div class="c1">第三个</div>
    <div class="c1">第四个</div>
    <div class="c1">第五个</div>
    <div class="c1">第六个</div>

    <span>这是SPAN1</span>
    <span>这是SPAN1</span>
    <span>这是SPAN1</span>
    <span>这是SPAN1</span>
    <span>这是SPAN1</span>
    <span>这是SPAN1</span>

    <div>
    样式的格式:
    样式名:样式的值
    多个样式之间用分号分隔

    选择器的优先级:
    标签选择器(span div)>*(所有)
    clasa选择器>标签选择器
    id选择器>class选择器

    ID>class>标签>*
    </div>

    <div id="d5" style="300px; height:200px; background-color:#6F9; position:absolute; left:500px; top:80px; z-index:-2;"><b>测试文字</b></div>
    <div id="d6" style="text-decoration:none; font-size:36px;">你好
    <a style="text-decoration:none" href="1.jpg" >超链接</a>
    </div>
    <br>

    <div id="n1" style="600px; height:600px; background-color:#000; border:5px solid #609; color:#FFF; box-shadow:0 0 50px #000000;">手机电脑第胜女的代价四十开导开导
    <div style="400px; height:400px; background-color:#6F0; margin:100px 100px 100px 100px; border:1px solid #0CF; box-shadow:0 0 50px #33FF00;">
    <div style="0px; height:0px;
    margin:100px 100px 100px 100px;
    border-top:100px solid #0CF;
    border-bottom:100px solid #6FF;
    border-left:100px solid #F30;
    border-right:100px solid #0FF;
    box-shadow:0 0 50px #FFFF00;">
    </div>
    </div>
    </div>


    <ul style="list-style:outside;">
    <li>看起来还好哈哈</li>
    <li>看起来还好哈哈</li>
    <li>看起来还好哈哈</li>
    <li>看起来还好哈哈</li>
    </ul>

    <div id="p1"></div>

    <div id="l1">
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    <div class="l2"><img src="yun.jpg" height="200px"; width="200px";></div>
    </div>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>


    <div id="z1">
    <div class="z2">一</div>
    <div class="z2">二</div>
    <div class="z2">三</div>
    <div class="z2">四</div>
    <div class="z2">五</div>
    </div>
    </body>
    </html>

  • 相关阅读:
    [计算机网络-传输层] 无连接传输:UDP
    [BinaryTree] 最大堆的类实现
    [OS] 生产者-消费者问题(有限缓冲问题)
    [剑指Offer] 64.滑动窗口的最大值
    [剑指Offer] 63.数据流中的中位数
    [剑指Offer] 62.二叉搜索树的第k个结点
    [OS] CPU调度
    [剑指Offer] 60.把二叉树打印成多行
    MySQL数据库实验二:单表查询
    数据库实验:基本表的定义与修改
  • 原文地址:https://www.cnblogs.com/ziyanxiaozhu/p/7648396.html
Copyright © 2020-2023  润新知