CSS3选择器

CSS3:
选择器:id class 标签 包含 关联
属性选择器:[attr*=val]属性attr的属性值为val的所有
        [attr^=val]属性attr的开头字母为val的所有
        [attr$=val]属性为attr的结束字母为val的所有
        [attr=val]匹配一个属性attr的属性值为val的
结构性伪类选择器:
    :root{  }  给html设置样式
    :not{ } 例:#box* :not(h1) id为box下不包含h1的所有元素
    :empty{ } 元素内容为空白的时候引用
    :target{ } 当超链接链入到某个元素时引用
    :first-child  第一个
    :last-child   最后一个
    :nth-child(1)  正数第一个
    :nth-last-child(2)  倒数第二个
     odd奇数 even偶数
    :nth-of-type(odd/even) 奇数行/偶数行
    :nth-child(1):nth-last-child(1) 是第一个也是最后一个
    :first-child:last-child 是第一个也是最后一个
    :onli-child 只有一个
状态伪类选择器
    :hover 鼠标移动上去
    :active 正在点击
    :focus 获取光标
    :enabled 能点击
    :disabled 不能点击
    :read-only 只读
    :read-write 可写
    :default 非选中
    :checked 选中状态
    :indeterminate 从来没被选过
    ::selection 元素处于选中状态是的样式
兄弟元素选择器
    某个元素~兄弟元素(同级别)

posted on 2016-10-25 18:56  落他眉骨  阅读(127)  评论(0)    收藏  举报

导航