CSS3

作者: 晓箬 | 来源:发表于2017-11-17 18:41 被阅读0次

选择器

    document.querySelectorAll();
    document.querySelector();

自定义属性

    data-xxxh
    oEle.dataset.xxx;

class操作

oEle.classList
            .length             长度
            .value              所有class
            操作
            .add()              添加
            .remove()           删除
            .contains()         包含
            .toggle()           切换

border-radius(圆角)

        border-radius:  px  %   em  rem;
        border-radius: 左上右上右下左下;
        border-radius: 左上右下 右上左下;
        border-radius: 左上 右上左下 右下;
        border-radius: 左上 右上 右下 左下;

浏览器前缀

        -webkit-        Chrome/Safari/opear/firefox(49+)
        -moz-           Firefox
        -ms-            IE
        -o-             Opear(old)
        不加前缀        W3C要求

        -webkit-border-radius       WebkitBorderRadius
        -moz-border-radius          MozBorderRadius
        -ms-border-radius           msBorderRadius
        -o-border-radius            OBorderRadius
        border-radius               borderRadius

阴影

盒子阴影
        box-shadow: x偏移 y偏移 阴影范围 color;
        box-shadow: [inset] x偏移 y偏移 阴影范围 color;
        box-shadow: [inset] x偏移 y偏移 阴影范围 [扩展] color;
            阴影可以叠加
            box-shadow: x y opacity color, x y opacity color...;

文字阴影
        text-shadow: x偏移 y偏移 阴影范围 color;
        text-shadow: x y opacity color, x y opacity color...;

运动

transition: duration style-type easing;

变形

        translate(x,y)          平移(x、y轴)
        rotate(deg)             旋转(z轴)
        scale(x倍数,y倍数)      缩放
        skew(xdeg,ydeg)         拉伸(扭曲)

设置圆心位置

transform-origin: 横向 纵向;

渐变

线性渐变
        linear-gradient(color1, color2);
        linear-gradient(color1, color2, color3...);
        改变方向
              linear-gradient(方向, color1, color2, color3...);
        范围渐变
              linear-gradient(color1 start, color1 end, color2 start, color2 end, color3 start, color3 end...);
        跳变
              repeating-linear-gradient(color1 start, color1 end, color2 start, color2 end...);
径向渐变
        radial-gradient(color1, color2);

文本切片


    1.给元素设置渐变背景
    2.设置文本切片
            -webkit-background-clip: text;
    3.文字透明

蒙版

-webkit-mask      显示有颜色的地方

transform

rotate()                Z轴旋转
rotateX()               X轴旋转
rotateY()               Y轴旋转

透视
    
    transform: perspective(透视值); 
        值   推荐800-1200
        大   不明显
        小   明显
translate(x,y)          x、y轴平移
translateZ()            Z轴平移

要改变translateZ,父级必须是3D
    -webkit-transform-style: preserve-3d;
    父级一定要透视
    如果父级有旋转XY之类的
    -webkit-transform: perspective() rotateX/Y();
    如果父级什么都不需要
    perspective: 800px;

注意:
    1.执行有顺序(后面的先执行)
    2.行元素有问题(不能操作行元素)

相关文章

  • 网页高级知识点(三)

    CSS3 transition动画 CSS3 transform变换 CSS3 animation动画

  • CSS3-目录

    1 CSS3 兼容性 2 CSS3 选择器 3 CSS3 新加属性 4 CSS3 过渡动画 5 CSS3 变型 6...

  • CSS3 背景

    知识点: CSS3 背景图像区域CSS3 背景图像定位CSS3 背景图像大小CSS3 多重背景图像CSS3 背景属...

  • css3渐变:线性和径向

    知识点: CSS3 渐变CSS3 线性渐变CSS3 径向渐变 CSS3 渐变 渐变(gradients)可以在两个...

  • CSS3设置圆角边框 圆角特效代码 CSS3的圆角border-

    CSS3设置圆角边框 css3圆角特效代码 CSS3 border-radius 属性 使用 CSS3 borde...

  • 07day

    CSS3动画 CSS3 @keyframes 规则如需在 CSS3 中创建动画,您需要学习 @keyframes ...

  • css3 基础

    1. css3 起步 (图形2D旋转) 2. CSS3 模块 CSS3 被划分为模块。其中最重要的 CSS3 ...

  • CSS3:边框与圆角

    知识点: CSS3圆角CSS3盒阴影CSS3边界图片 一、CSS3圆角 border-radius属性 一个最多可...

  • css3圆角

    css3 圆角使用 CSS3 border-radius 属性,你可以给任何元素制作 "圆角"。CSS3 bord...

  • 1217

    资源:css3制作工具css3按钮生成css3制作特殊效果-web前端实验室 浏览器的型号和css3前缀 五种主流...

网友评论

      本文标题:CSS3

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