123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- body{
- margin: 0;
- }
- figure{
- margin: 0;
- margin-top: 20px;
- }
- .container{
- max-width: 980px;
- margin: 0 auto;
- }
- header,nav,footer{
- background-color: #ccc;
- height: 50px;
- font-size: 30px;
- font-weight: bolder;
- color: #111;
- text-align: center;
- line-height: 50px;
- margin-top: 20px;
- }
- figure{
- width: 100%;
- }
-
- figure img{
- width: 100%;
- display: none;
- }
- figure img:first-child{
- display: block;
- }
- .info-content{
- display: flex;
- margin-top: 20px;
- }
- .info-content article{
- background-color: orange;
- margin-right: 20px;
- width: 70%;
- }
- .info-content aside{
- background-color: green;
- width: 30%;
- }
- @media screen and (max-width:980px){
- .container figure img{
- display: none;
- }
- figure img:nth-child(2){
- display: block;
- }
- }
- @media screen and (max-width:480px){
- .container figure img{
- display: none;
- }
- figure img:nth-child(3){
- display: block;
- }
- .info-content{
- flex-direction: column;
- }
- .info-content article{
- width: 100%;
- }
- .info-content aside{
- width: 100%;
- margin-top: 20px;
- }
- }
- </style>
- </head>
- <body>
- <div class="container">
- <header>页头</header>
- <nav>导航</nav>
- <figure>
- <img src="./img/1.jpg" alt="img">
- <img src="./img/2.jpg" alt="img">
- <img src="./img/3.jpg" alt="img">
- </figure>
- <div class="info-content">
- <article>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sem erat, egestas quis luctus ut, rhoncus vitae risus. Integer venenatis libero sit amet sapien dictum, quis bibendum mi volutpat. Cras pretium quam quis magna facilisis, eget feugiat nisi lacinia.</article>
- <aside>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sem erat, egestas quis luctus ut, rhoncus vitae risus. Integer venenatis libero sit amet sapien dictum, quis bibendum mi volutpat. Cras pretium quam quis magna facilisis, eget feugiat nisi lacinia.</aside>
- </div>
- <footer>页脚</footer>
- </div>
- </body>
- </html>
|