html { overflow: hidden; touch-action: none; content-zooming: none; } body { position: absolute; margin: 0 padding: 0 background: #111; width: 100%; height: 100%; } #canvas { width: 100%; height: 100%; background: #fff; position: absolute; } #text { position: absolute; left: 0; bottom: 10px; width: 100%; pointer-events: none; } #text div { position:absolute; color: #888; left:0 width:100% text-align:center; top:-32px; font-family: 'Poiret One', cursive; font-size:32px; }帮我定位错误
时间: 2024-01-01 12:04:43 浏览: 354
您提供的代码有两处缺少分号:
1. `margin: 0 padding: 0` 应该改为 `margin: 0; padding: 0;`
2. `left:0 width:100% text-align:center;` 应该改为 `left:0; width:100%; text-align:center;`
修改后的代码如下:
```css
html {
overflow: hidden;
touch-action: none;
content-zooming: none;
}
body {
position: absolute;
margin: 0;
padding: 0;
background: #111;
width: 100%;
height: 100%;
}
#canvas {
width: 100%;
height: 100%;
background: #fff;
position: absolute;
}
#text {
position: absolute;
left: 0;
bottom: 10px;
width: 100%;
pointer-events: none;
}
#text div {
position:absolute;
color: #888;
left:0;
width:100%;
text-align:center;
top:-32px;
font-family: 'Poiret One', cursive;
font-size:32px;
}
```
阅读全文