css中如何选择奇数行与偶数行

  1.  
    <style>  
    #Ulist li:nth-of-type(odd){ margin-left: 20px;}奇数行   
    #Ulist li:nth-of-type(even){margin-left: 10px;}偶数行   
    <style>  
      
    <ul id="Ulist">  
    <li>1</li>  
    <li>2</li>  
    <li>3</li>  
    <li>4</li>  
    <li>5</li>  
    <li>6</li>  
    </ul>

猜你喜欢

转载自blog.csdn.net/qq_39511525/article/details/80346628
今日推荐