style>
body {

font-f**ily: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
background-color: #f9f9f9;
**rgin: 0;
padding: 0;
}
.container {
**x-width: 800px;
**rgin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
border-radius: 10px;
}
h1 {
font-size: 36px;
text-align: center;
**rgin-bot***: 30px;
}
.question {
**rgin-bot***: 20px;
}
.question h2 {
font-size: 24px;
**rgin-bot***: 10px;
}
.answer {
display: flex;
flex-direction: column;
**rgin-bot***: 10px;
}
.answer label {
font-size: 20px;
cursor: pointer;
padding: 10px;
border: 2px solid #ccc;
border-radius: 5px;
transition: all 0.3s;
}
.answer label:hover {
background-color: #f9f9f9;
}
.answer input[type="radio"] {
display: none;
}
.result {
font-size: 24px;
font-weight: bold;
text-align: center;
**rgin-top: 30px;
}
/style
10道有趣的性格测试题,看看你的个性特点是什么?meta charset="UTF-8">
style>
body {
font-f**ily: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
background-color: #f9f9f9;
**rgin: 0;
padding: 0;
}
.container {
**x-width: 800px;
**rgin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
border-radius: 10px;
}
h1 {
font-size: 36px;
text-align: center;
**rgin-bot***: 30px;
}
.question {
**rgin-bot***: 20px;
}
.question h2 {
font-size: 24px;
**rgin-bot***: 10px;
}
.answer {
display: flex;
flex-direction: column;
**rgin-bot***: 10px;
}
.answer label {
font-size: 20px;
cursor: pointer;
padding: 10px;
border: 2px solid #ccc;
border-radius: 5px;
transition: all 0.3s;
}
.answer label:hover {
background-color: #f9f9f9;
}
.answer input[type="radio"] {
display: none;
}
.result {
font-size: 24px;
font-weight: bold;
text-align: center;
**rgin-top: 30px;
}
/style
body>
10道有趣的性格测试题,看看你的个性特点是什么?
script>
const form = document.querySelector('form');
const result = document.querySelector('.result');
const answers = ['home', 'blue', 'both', 'summer', 'medium', 'classical', 'yoga', 'morning', 'both', 'books'];
form.addEventListener('submit', (event) => {
event.preventDefault();
let score = 0;
const checkedAnswers = [];
form.querySelectorAll('input[type="radio"]:checked').forEach((answer) => {
checkedAnswers.push(answer.value);
});
checkedAnswers.forEach((answer, index) => {
if (answer === answers[index]) {
score += 1;
}
});
let personality = '';
if (score < 3) {
personality = '你比较内向,喜欢安静的环境,对细节很有