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;
    }




     

  • 相关阅读:
    【引用】关于closeonexec标志
    CentOS解决编码问题
    /etc/init.d/functions (转)
    centos 安装 中文 支持 语言包(转)
    vsftpd 530 错误
    __FILE__,__LINE__,FUNCTION__实现代码跟踪调试(linux下c语言编程)(转)
    C语言中可变参数的用法 va_start va_end(转)
    守护进程 setsid(转)
    /dev/null 重定向 ./sh >/dev/null 2>&1
    C# 子类调用父类构造函数
  • 原文地址:https://www.cnblogs.com/ae6623/p/4416528.html
Copyright © 2011-2022 走看看