栅格系统
Document
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> * { margin: 0; padding: 0; } [class^=col] { float: left; } .col25 { width: 25%; background-color: aqua; } .col50 { width: 50%; background-color: blue; } .col75 { width: 75%; background-color: red; } </style> </head> <body>
<div> <h2>1</h2> <div class="col25">A</div> <div class="col25">A</div> <div class="col25">A</div> <div class="col25">A</div> <h2>2</h2> <div class="col25">A</div> <div class="col25">A</div> <div class="col50">B</div> <h2>3</h2> <div class="col25">A</div> <div class="col50">B</div> <div class="col25">A</div> <h2>4</h2> <div class="col50">B</div> <div class="col25">A</div> <div class="col25">A</div> <h2>5</h2> <div class="col75">C</div> <div class="col25">A</div> <h2>6</h2> <div class="col25">A</div> <div class="col75">C</div> </div>
</body> </html>
1
A
A
A
A
2
A
A
B
3
A
B
A
4
B
A
A
5
C
A
6
A
C