帮我写一个红蓝双方对战的html页面
时间: 2023-08-20 07:08:52 浏览: 31
好的,以下是一个简单的红蓝双方对战的html页面:
```html
<!DOCTYPE html>
<html>
<head>
<title>红蓝双方对战</title>
<style>
/* 设置页面背景色 */
body {
background-color: #f2f2f2;
}
/* 设置红色方块的样式 */
.red {
width: 50px;
height: 50px;
background-color: red;
position: absolute;
top: 50px;
left: 50px;
}
/* 设置蓝色方块的样式 */
.blue {
width: 50px;
height: 50px;
background-color: blue;
position: absolute;
top: 150px;
left: 150px;
}
</style>
</head>
<body>
<div class="red"></div>
<div class="blue"></div>
</body>
</html>
```
在这个页面中,我们使用了两个 `div` 元素来表示红色方块和蓝色方块,并为它们设置了相应的样式。这两个方块的初始位置分别为 `(50, 50)` 和 `(150, 150)`。
你可以根据自己的需要修改样式和位置,让页面更加符合你的需求。