zoukankan      html  css  js  c++  java
  • css3的选择器有哪几种?

    *通用选择器,ID选择器 ,.类选择器class,标签选择器,标签组合选择器,伪类选择器:,+相邻元素选择器,>子元素选择器,~同辈选择器,
    x[title]属性选择器[type="button"],
    x[href^="http"]匹配以href值为http打头的地址,
    x[href$=".jpg"]匹配所有的图片链接
    input[type=checkbox]:checked{};选择checkbox为当前选中的那个标签。

    伪类选择器 ------:
    p:empty 选择没有子元素的每个 <p> 元素(包括文本节点)。
    :first-child 第一个
    :last-child 最后一个
    :nth-child(11) 1--11个
    x:first/x:after 在x选择器之前或者之后插入内容

    伪元素选择器
    ::before ,::after 通过 css 模拟出来html标签的效果

  • 相关阅读:
    函数的扩展
    数组的扩展
    event(1)
    面试
    iframes
    浏览器CSS兼容
    BFC
    简单的一个轮播效果
    asp.net identity 2.2.0 在WebForm下的角色启用和基本使用(二)
    我的web框架设计
  • 原文地址:https://www.cnblogs.com/crazycode2/p/11954645.html
Copyright © 2011-2022 走看看