zoukankan      html  css  js  c++  java
  • CSS3——阴影


     

    例A显示了一层阴影,偏移量的左侧和顶部各5px:

    #Example_A {
    -moz-box-shadow: -5px -5px #888;
    -webkit-box-shadow: -5px -5px #888;
    box-shadow: -5px -5px #888;
    }  

    例B显示了5px模糊距离相同的阴影:

    #Example_B {
    -moz-box-shadow: -5px -5px 5px #888;
    -webkit-box-shadow: -5px -5px 5px #888;
    box-shadow: -5px -5px 5px #888;
    }

    例C显示了传播的5px距离相同的阴影:

    #Example_C {
    -moz-box-shadow: -5px -5px 0 5px #888;
    -webkit-box-shadow: -5px -5px 0 5px#888;
    box-shadow: -5px -5px 0 5px #888;
    }

    例D显示了相同的影子,既具有模糊5px距离和传播距离的5px:

    #Example_D {
    -moz-box-shadow: -5px -5px 5px 5px #888;
    -webkit-box-shadow: -5px -5px 5px 5px#888;
    box-shadow: -5px -5px 5px 5px #888;
    }

    例E显示了无偏移的阴影的模糊距离5px:

    #Example_E {
    -moz-box-shadow: 0 0 5px #888;
    -webkit-box-shadow: 0 0 5px#888;
    box-shadow: 0 0 5px #888;
    }

    例F显示了一个没有偏移的阴影和模糊的5px距离和传播距离的5px:

    #Example_F {
    -moz-box-shadow: 0 0 5px 5px #888;
    -webkit-box-shadow: 0 0 5px 5px#888;
    box-shadow: 0 0 5px 5px #888;
    }

    Example G shows an inner shadow offset to the left and top by 5px:

    #Example_G {
    -moz-box-shadow: inset -5px -5px #888;
    -webkit-box-shadow: inset -5px -5px #888;
    box-shadow: inset -5px -5px #888;
    }

    Example H shows the same inner shadow with a blur distance of 5px:

    #Example_H {
    -moz-box-shadow: inset -5px -5px 5px #888;
    -webkit-box-shadow: inset -5px -5px 5px #888;
    box-shadow: inset -5px -5px 5px #888;
    }

    Example I shows the same inner shadow with a spread distance of 5px:

    #Example_I {
    -moz-box-shadow: inset -5px -5px 0 5px #888;
    -webkit-box-shadow: inset -5px -5px 0 5px#888;
    box-shadow: inset -5px -5px 0 5px #888;
    }

    Example J shows the same inner shadow with both a blur distance of 5px and a spread distance of 5px:

    #Example_J {
    -moz-box-shadow: inset -5px -5px 5px 5px #888;
    -webkit-box-shadow: inset -5px -5px 5px 5px#888;
    box-shadow: inset -5px -5px 5px 5px #888;
    }

    Example K shows an inner shadow with no offset and a blur distance of 5px:

    #Example_K {
    -moz-box-shadow: inset 0 0 5px #888;
    -webkit-box-shadow: inset 0 0 5px#888;
    box-shadow: inner 0 0 5px #888;
    }

    Example L shows an inner shadow with no offset and both a blur distance of 5px and a spread distance of 5px:

    #Example_L {
    -moz-box-shadow: inset 0 0 5px 5px #888;
    -webkit-box-shadow: inset 0 0 5px 5px#888;
    box-shadow: inset 0 0 5px 5px #888;
    }

    Example M shows five shadows specified in the following order; firstly a black shadow with a spread distance of px and a blur distance of px, secondly a lime shadow offset to the top right, thirdly a red shadow offset to the bottom right with a blur distance applied, fourthly a yellow shadow offset to the bottom left, and lastly a blue shadow offset to the top left with a blur distance applied:

    #Example_M {
    -moz-box-shadow: 0 0 10px 5px black, 40px -30px lime, 40px 30px 50px red, -40px 30px yellow, -40px -30px 50px blue;
    -webkit-box-shadow: 0 0 10px 5px black, 40px -30px lime, 40px 30px 50px red, -40px 30px yellow, -40px -30px 50px blue;
    box-shadow: 0 0 10px 5px black, 40px -30px lime, 40px 30px 50px red, -40px 30px yellow, -40px -30px 50px blue;
    }

    Example N shows a black shadow, specified using standard RGB color, offset to the right and bottom by 5px:

    #Example_N {
    -moz-box-shadow: 5px 5px rgb(0,0,0);
    -webkit-box-shadow: 5px 5px rgb(0,0,0);
    box-shadow: 5px 5px rgb(0,0,0);
    }

    Example O shows the same shadow, this time with the color black specified using RGBa color with an opacity of 70%:

    #Example_O {
    -moz-box-shadow: 5px 5px rgba(0,0,0,0.7);
    -webkit-box-shadow: 5px 5px rgba(0,0,0,0.7);
    box-shadow: 5px 5px rgba(0,0,0,0.7);
    }

    Example P shows the same shadow, this time with the color black specified using RGBa color with an opacity of 50%:

    #Example_P {
    -moz-box-shadow: 5px 5px rgba(0,0,0,0.5);
    -webkit-box-shadow: 5px 5px rgba(0,0,0,0.5);
    box-shadow: 5px 5px rgba(0,0,0,0.5);
    }   


    Example Q shows a shadow offset to the bottom and right by 5px, with a border-radius of 5px applied to each corner:

    #Example_Q {
    -moz-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 5px 5px black;
    -webkit-box-shadow: 5px 5px black;
    box-shadow: 5px 5px black;
    }

    Example R shows the same shadow with a blur distance of 5px:

    #Example_R {
    -moz-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 5px 5px 5px black;
    -webkit-box-shadow: 5px 5px 5px black;
    box-shadow: 5px 5px 5px black;
    }




     

  • 相关阅读:
    Python系列:四、Python函数--技术流ken
    Centos7破解密码的两种方法--技术流ken
    Python系列:三、流程控制循环语句--技术流ken
    Python系列:二、数据类型--技术流ken
    Python系列:一、Python概述与环境安装--技术流ken
    zabbix实现百台服务器的自动化监控--技术流ken
    学会这个删库再也不用跑路了~ --技术流ken
    五分钟彻底学会iptables防火墙--技术流ken
    Docker之使用Dockerfile创建定制化镜像(四)--技术流ken
    Docker数据卷Volume实现文件共享、数据迁移备份(三)--技术流ken
  • 原文地址:https://www.cnblogs.com/ae6623/p/4416528.html
Copyright © 2011-2022 走看看