求助:代码生成按钮出错
javascript吧
全部回复
仅看楼主
level 1
代码如下
'''
<!DOCTYPE html>
<html>
<head>
<title>LED控制</title>
<style>
body {
text-align: center;
font-family: Arial;
}
button {
padding: 20px;
font-size: 20px;
}
.button-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 30px;
max-width: 600px;
margin: 0 auto;
}
</style>
</head>
<body>
<h1>ESP8266 Car Remote Control</h1>
<div class="button-container">
<a href="/cruise"><button style="background: green;">Cruise</button></a>
<a href="/forward"><button style="background: yellow;">Forward</button></a>
<a href="/brake"><button style="background: red;">Brake</button></a>
<a href="/left"><button style="background: yellow;">L</button></a>
<a href="/reverse"><button style="background: yellow;">Reverse</button></a>
<a href="/right"><button style="background: yellow;">RRR</button></a>
<a href="/return"><button style="background: yellow;">Return</button></a>
</div>
</body>
</html>
'''
显然这段代码应该生成7个按钮,但实际效果只有6个
效果图二楼发
2025年03月21日 16点03分 1
level 1
2025年03月21日 16点03分 2
1