You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.0 KiB
64 lines
2.0 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>进制转换</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 20px;
|
|
}
|
|
.container {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
}
|
|
.form-group {
|
|
margin-bottom: 15px;
|
|
}
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 5px;
|
|
}
|
|
.form-group input {
|
|
width: 100%;
|
|
padding: 8px;
|
|
box-sizing: border-box;
|
|
}
|
|
.result {
|
|
margin-top: 20px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>进制转换工具</h1>
|
|
<div class="form-group">
|
|
<label for="number">输入数字:</label>
|
|
<input type="text" id="number" placeholder="请输入数字">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="fromBase">原始进制:</label>
|
|
<select id="fromBase">
|
|
<option value="2">2进制</option>
|
|
<option value="8">8进制</option>
|
|
<option value="10" selected>10进制</option>
|
|
<option value="16">16进制</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="toBase">转换到:</label>
|
|
<select id="toBase">
|
|
<option value="2">2进制</option>
|
|
<option value="8">8进制</option>
|
|
<option value="10">10进制</option>
|
|
<option value="16">16进制</option>
|
|
</select>
|
|
</div>
|
|
<button onclick="convertNumber()">转换</button>
|
|
<div class="result" id="result"></div>
|
|
</div>
|
|
|
|
<script src="srcipt.js"></script>
|
|
</body>
|
|
</html> |