-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubwebpage.html
47 lines (46 loc) · 1.51 KB
/
subwebpage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>int2bin</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 40px;
background-color: #4444f4; /* 保持背景颜色为浅灰色 */
color: #ff0000; /* 文本颜色改为红色 */
}
h1 {
color: #00ff00; /* 标题颜色改为绿色 */
}
#output {
margin-top: 20px;
color: #00ffff; /* 输出结果的颜色也改为绿色 */
}
button {
background-color: #ffff00; /* 按钮背景颜色为红色 */
color: #ff7777; /* 按钮文字颜色为白色,以便于阅读 */
border: none;
padding: 10px 20px;
cursor: pointer;
}
button:hover {
background-color: #cc0000; /* 鼠标悬停时按钮颜色变深 */
}
</style>
</head>
<body>
<h1>工具</h1>
<input type="number" id="numberInput" placeholder="底色:输入一个整数">
<button onclick="convertToBinary()">转换按钮按钮button</button>
<div id="output"></div>
<script>
function convertToBinary() {
var number = document.getElementById('numberInput').value;
var binary = "输出位置二进制: " + parseInt(number).toString(2);
document.getElementById('output').textContent = binary;
}
</script>
</body>
</html>