[css3]切换图片知识点

来源:互联网 发布:mac双系统win8蓝屏 编辑:程序博客网 时间:2024/05/18 03:56
imooc 网自学的小测试 CSS-切换图片
http://www.imooc.com/code/1882
学习点一:伪类选择器:
动态伪类:L oVeHAte
.demo a:link {color:gray;}/*链接没有被访问时前景色为灰色*/
.demo a:visited{color:yellow;}/*链接被访问过后前景色为黄色*/
.demo a:hover{color:green;}/*鼠标悬浮在链接上时前景色为绿色*/
.demo a:active{color:blue;}/*鼠标点中激活链接那一下前景色为蓝色*/

nth选择器

 :first-child选择某个元素的第一个子元素;
 :last-child选择某个元素的最后一个子元素;
 :nth-child()选择某个元素的一个或多个特定的子元素;
 :nth-last-child()选择某个元素的一个或多个特定的子元素,从这个元素的最后一个子元素开始算;从1开始算
 :nth-of-type()选择指定的元素;
 :nth-last-of-type()选择指定的元素,从元素的最后一个开始计算;
 :first-of-type选择一个上级元素下的第一个同类子元素;
 :last-of-type选择一个上级元素的最后一个同类子元素;
 :only-child选择的元素是它的父元素的唯一一个了元素;
 :only-of-type选择一个元素是它的上级元素的唯一一个相同类型的子元素;
 :empty选择的元素里面没有任何内容;

否定选择器

input:not([type="submit"]) {border: 1px solid red;}

伪元素

:first-line,:first-letter,:before,:after;

元素状态伪类

        :enabled,:disabled ;:checked;:target

input[type="text"]:disabled {border:1px solid #999;background-color: #fefefe;}

学习点二:将图片动画设置为类,方便调用

学习点三:动画设置关键帧

           @-webkit-keyframes 'rotate' {            0% { -webkit-transform: rotate(-360deg) scale(0.1); }            100% { -webkit-transform: none; }            }            @-moz-keyframes 'rotate' {            0% { -moz-transform: rotate(-360deg) scale(0.1); }            100% { -moz-transform: none; }            }            @-ms-keyframes 'rotate' {            0% { -ms-transform: rotate(-360deg) scale(0.1); }            100% { -ms-transform: none; }            }            @-o-keyframes 'rotate' {            0% { -o-transform: rotate(-360deg) scale(0.1); }            100% { -o-transform: none; }            }            @keyframes 'rotate' {            0% { transform: rotate(-360deg) scale(0.1); }            100% { transform: none; }            }

     /*背景图旋转出现*/            .rotate:target{            <span style="white-space:pre"></span>z-index: 100;            <span style="white-space:pre"></span>-webkit-animation-name: rotate;            <span style="white-space:pre"></span>-webkit-animation-duration: 1s;            <span style="white-space:pre"></span>-webkit-animation-iteration-count: 1;            <span style="white-space:pre"></span>-moz-animation-name: rotate;            <span style="white-space:pre"></span>-moz-animation-duration: 1s;            <span style="white-space:pre"></span>-moz-animation-iteration-count: 1;            <span style="white-space:pre"></span>-ms-animation-name: rotate;            <span style="white-space:pre"></span>-ms-animation-duration: 1s;            <span style="white-space:pre"></span>-ms-animation-iteration-count: 1;            <span style="white-space:pre"></span>-o-animation-name: rotate;            <span style="white-space:pre"></span>-o-animation-duration: 1s;            <span style="white-space:pre"></span>-o-animation-iteration-count: 1;            <span style="white-space:pre"></span>animation-name: rotate;            <span style="white-space:pre"></span>animation-duration: 1s;            <span style="white-space:pre"></span>animation-iteration-count: 1;            }
0 0
原创粉丝点击