| 1234567891011121314151617181920212223242526272829303132 |
- <!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>
- .box{
- width: 300px;
- height: 300px;
- border:3px solid blue;
- position: relative;
- }
- .item{
- position: absolute;
- width: 100px;
- height: 100px;
- background-color: red;
- left: 50%;
- margin-left: -50px;
- top: 50%;
- margin-top: -50px;
- }
- </style>
- </head>
- <body>
- <div class="box">
- <div class="item"></div>
- </div>
- </body>
- </html>
|