html span從上往下,從左往右排序


<html> 
<head> 
<meta charset="utf-8"/> 
<title>從上往下,從左往右</title> 
<style> 
    #flex-container {flex-flow:column wrap; } 

    #flex-container > :nth-child(4n - 2) { order: 1; }
    #flex-container > :nth-child(4n - 1) { order: 2; }
    #flex-container > :nth-child(4n - 0) { order: 3; }
    #flex-container > :nth-child(-n + 4) {
        page-break-before: always; /* Old syntax */
        break-before: always;  /* New syntax */
        border-top: 1px solid;
    }
</style> 
</head> 
<body> 

<div id="flex-container">
  <span>1</span>
  <span>2</span>
  <span>3</span>
  <span>4</span>
  <span>5</span>
  <span>6</span>
  <span>7</span>
  <span>8</span>
  <span>9</span>
  <span>10</span>
</div>

</body> 
</html> 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM