<!DOCTYPE html>
<html>
<head>
	<title>问答页面</title>
	<style>
		body {
			font-family: Arial, sans-serif;
			margin: 0;
			padding: 0;
			background-color: #f1f1f1;
		}
<pre><code>	.container {
		max-width: 800px;
		margin: 0 auto;
		padding: 20px;
		background-color: #fff;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
	}
	
	h1 {
		font-size: 36px;
		margin-bottom: 20px;
		text-align: center;
	}
	
	form {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-bottom: 20px;
	}
	
	label {
		font-size: 24px;
		margin-bottom: 10px;
	}
	
	input[type=&quot;text&quot;] {
		padding: 10px;
		font-size: 24px;
		border: 2px solid #ccc;
		border-radius: 5px;
		width: 100%;
		max-width: 500px;
		margin-bottom: 20px;
		box-sizing: border-box;
	}
	
	button {
		padding: 10px 20px;
		font-size: 24px;
		background-color: #4CAF50;
		color: #fff;
		border: none;
		border-radius: 5px;
		cursor: pointer;
		transition: background-color 0.3s ease;
	}
	
	button:hover {
		background-color: #3e8e41;
	}
	
	#answer {
		padding: 20px;
		font-size: 24px;
		border: 2px solid #ccc;
		border-radius: 5px;
		width: 100%;
		max-width: 500px;
		min-height: 200px;
		box-sizing: border-box;
	}
&lt;/style&gt;
</code></pre>
</head>
<body>
	<div class="container">
		<h1>欢迎来到问答页面</h1>
		<form>
			<label for="question">请输入您的问题:</label>
			<input type="text" id="question" name="question" required>
			<button type="submit" onclick="answerQuestion()">开始回答</button>
		</form>
		<div id="answer"></div>
	</div>
	<script>
		function answerQuestion() {
			// 获取输入框中的问题
			var question = document.getElementById("question").value;
<pre><code>		// 在回答框中显示回答
		var answer = document.getElementById(&quot;answer&quot;);
		answer.innerHTML = &quot;您的问题是:&quot; + question;
	}
&lt;/script&gt;
</code></pre>
</body>
</html>

原文地址: https://www.cveoy.top/t/topic/EpF 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录