移动端流式布局案例附代码
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>流式布局案例-IT战蚁</title>
- <style>
- body {
- margin: 0px;
- }
-
- section {
- max-width: 980px;
- min-width: 320px;
- margin: 0 auto;
- }
-
- section div:nth-child(1) {
- float: left;
- width: 50%;
- height: 200px;
- background-color: pink;
- }
-
- section div:nth-child(2) {
- float: left;
- width: 50%;
- height: 200px;
- background-color: red;
- }
- </style>
- </head>
- <body>
- <section>
- <div></div>
- <div></div>
- </section>
- </body>
- </html>
复制代码
|
|