12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <!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;
- }
- h3{
- width: 980px;
- height: 50px;
- background: #cccccc;
- line-height: 50px;
- text-align: center;
- margin: 0 auto 10px;
- }
- #img1{
- display: block;
- width: 980px;
- margin: 0 auto;
- }
- #img2,#img3{
- display: none;
- }
- #content{
- width: 980px;
- margin: 10px auto;
- overflow: hidden;
- }
- #left{
- width: 630px;
- height: 300px;
- background: red;
- float: left;
- }
- #right{
- width: 340px;
- height: 300px;
- background: blue;
- float: right;
- }
- @media screen and (max-width: 980px) {
- h3{
- width: 100%;
- }
- #img1,#img3{
- display: none;
- }
- #img2{
- display: block;
- width: 100%;
- }
- #content{
- width: 100%;
- }
- #left{
- width: 65%;
- }
- #right{
- width: 34%;
- }
- }
- @media screen and (max-width:480px) {
- #img1,#img2{
- display: none;
- }
- #img3{
- display: block;
- width: 100%;
- }
- #left{
- width: 100%;
- }
- #right{
- width: 100%;
- }
- }
- </style>
- </head>
- <body>
- <h3>页眉</h3>
- <h3>导航</h3>
- <img id="img1" src="img/1.jpg" alt="">
- <img id="img2" src="img/2.jpg" alt="">
- <img id="img3" src="img/3.jpg" alt="">
- <div id="content">
- <div id="left"></div>
- <div id="right"></div>
- </div>
- <h3>页尾</h3>
- </body>
- </html>
|