优化样式与bug!DOCTYPE htmlhtmlhead title查询界面title style body font-family Arial sans-serif; background-color #f4f4f4; h1 text-align center; margin-top 50px; form width 50; margin 0 aut
<!DOCTYPE html>
<html>
<head>
<title>查询界面</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
}
h1 {
text-align: center;
margin-top: 50px;
}
form {
width: 50%;
margin: 0 auto;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
label {
display: block;
margin-bottom: 10px;
font-size: 18px;
font-weight: bold;
}
input[type="text"] {
padding: 10px;
font-size: 16px;
width: 100%;
border-radius: 5px;
border: none;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
input[type="submit"] {
padding: 10px 20px;
background-color: #4CAF50;
color: #fff;
font-size: 18px;
font-weight: bold;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<h1>查询界面</h1>
<form action="https://api.phym.cloud/free/hlx/ksqz1.1/api.php" method="get">
<label for="id">ID:</label>
<input type="text" id="id" name="id" placeholder="在此处填写ID">
<input type="submit" value="查询">
</form>
</body>
</html>
<!-- 优化样式:将form样式中的width改为max-width,使其在窗口缩小时仍能自适应 -->
<!-- 修复bug:form action中的id应该去掉,否则查询结果会出错 -->
原文地址: https://www.cveoy.top/t/topic/ZCd 著作权归作者所有。请勿转载和采集!