zoukankan      html  css  js  c++  java
  • 常用CSS选择器

    1. 标签选择器
      语法:
      1. HTML标签名 {属性:值;}
    2. 类选择器
      语法:
      1. .自定义类名 {属性:值;}
    3. 后代选择器
      语法:
      1. 选择器 选择器 {属性:值;}  /*标签之间必须是嵌套关系*/
    4. 并集选择器
      语法:
      1. 选择器,选择器 {属性:值;}
    5. 伪类选择器
      语法:
      1. 类名:hover {属性:值;}  /*鼠标指针浮动样式*/
      2. 类名:link {属性:值;}  /*选择所有未被访问的链接*/
      3. 类名:visited {属性:值;}  /*选择所有已被访问的链接*/
      4. 类名:active {属性:值;}  /*选择活动链接*/
      5. 类名:focus {属性:值;}  /*选择获得焦点的 input 元素*/
      6. 类名:first-letter {属性:值;}  /*选择每个 <p> 元素的首字母*/
      7. 类名:first-line {属性:值;}  /*选择每个 <p> 元素的首行*/
      8. 类名:first-child {属性:值;}  /*选择属于父元素的第一个子元素的每个 <p> 元素*/
      9. 类名:before {属性:值;}  /*在每个 <p> 元素的内容之前插入内容*/
      10. 类名:after {属性:值;}  /*在每个 <p> 元素的内容之后插入内容*/
      11. 类名:lang(language) {属性:值;}  /*选择带有以 "it" 开头的 lang 属性值的每个 <p> 元素*/
         
    6. 结构伪类选择器
      语法:
      1. .类名 :nth-child(n) {属性:值;}  /*第n行*/
      2. .类名 :first-child {属性:值;}  /*第1行*/
      3. .类名 :last-child {属性:值;}  /*最后1行*/
      4. .类名 :nth-last-child(n) {属性:值;}  /*倒数第n行*/
  • 相关阅读:
    CF #536div2E(dp)
    BZOJ2440(容斥+莫比乌斯函数)
    莫比乌斯反演题目结(下)
    struts 文件上传示例
    struts 文件上传示例
    struts2请求过程源码分析
    struts2请求过程源码分析
    如何快速成为数据分析师?
    如何快速成为数据分析师?
    多对多 hibernate映射
  • 原文地址:https://www.cnblogs.com/axibug/p/13169376.html
Copyright © 2011-2022 走看看