zoukankan      html  css  js  c++  java
  • 1-选择器 计算法

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    /*简单数字序号写法*/
    li:nth-child(2){
       background-color:yellow;
    }
    /*倍数写法*/
    li:nth-child(3n){
       background-color:green;
    }
    /*倍数分组匹配*/
    li:nth-child(3n+1){
       background-color:red;
    }
    /*奇偶匹配*/
    ol li:nth-child(odd){
       background-color:pink;
    }
    
    ol li:nth-child(even){
       background-color:blue;
    }
    
    /*only-child*/
    #olid li:only-child{
       color:red;
    }
    
    #olid2 li:last-child{
       color:red;
    }
    </style>
    </head>
    
    <body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
    
    <ol>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ol>
    
    <ol id="olid">
        <li>1</li>
    </ol>
    
    <ol id="olid2">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ol>
    </body>
    </html>
    

      

  • 相关阅读:
    gflag使用
    INTERVIEW #2
    Decision Tree
    Java FAQ
    K-Nearest Neighbors
    INTERVIEW #1
    C++ FAQ
    INTERVIEW #0
    Selection Sort
    TCP 3-Way Handshake
  • 原文地址:https://www.cnblogs.com/1020182600HENG/p/7079675.html
Copyright © 2011-2022 走看看