"爱豆小智"、"猫妹妹"、"奶糖男友"等都是趣味横生且个性十足的昵称。
<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: 0;
padding: 0;
}
.error {
color: red;
font-size: 16px;
margin-bottom: 10px;
}
.list-group-item {
background-color: #f5f5f5;
border-radius: 4px;
cursor: pointer;
margin-bottom: 20px;
padding: 10px;
}
.list-group-item:hover {
background-color: #ddd;
}
.category {
list-style-type: none;
padding-left: 0;
margin-top: 10px;
}
@media screen and (max-width: 600px) {
.list-group-item {
display: block;
}
}
</style>
<div class="category">有趣的昵称</div>
<div class="error"></div>
<ul class="list-group">
<li class="list-group-item" onclick="selectCategory('美食之旅')">美食之旅</li>
<li class="list-group-item" onclick="selectCategory('山水之行')">山水之行</li>
<li class="list-group-item" onclick="selectCategory('城市探险者')">城市探险者</li>
<li class="list-group-item" onclick="selectCategory('购物狂欢')">*</li>
<li class="list-group-item" onclick="selectCategory('明星粉丝')">明星粉丝</li>
<li class="list-group-item" onclick="selectCategory('幽默大师')">幽默大师</li>
<li class="list-group-item" onclick="selectCategory('好学生')">好学生</li>
<li class="list-group-item" onclick="selectCategory('运动达人')">运动达人</li>
<li class="list-group-item" onclick="selectCategory('旅行爱好者')">旅行爱好者</li>
<li class="list-group-item" onclick="selectCategory('童趣大冒险')">童趣大冒险</li>
<li class="list-group-item" onclick="selectCategory('超级粉丝')">超级粉丝</li>
<li class="list-group-item" onclick="selectCategory('创意工作者')">创意工作者</li>
<li class="list-group-item" onclick="selectCategory('设计师')">设计师</li>
<li class="list-group-item" onclick="selectCategory('漫画家')">漫画家</li>
<li class="list-group-item" onclick="selectCategory('摄影家')">摄影家</li>
<li class="list-group-item" onclick="selectCategory('程序员')">程序员</li>
<li class="list-group-item" onclick="selectCategory('作家')">作家</li>
<li class="list-group-item" onclick="selectCategory('导游')">导游</li>
<li class="list-group-item" onclick="selectCategory(' *** 红人')"> *** 红人</li>
<li class="list-group-item" onclick="selectCategory('音乐家')">音乐家</li>
<li class="list-group-item" onclick="selectCategory('喜剧演员')">喜剧演员</li>
<li class="list-group-item" onclick="selectCategory('体育迷')">体育迷</li>
<li class="list-group-item" onclick="selectCategory('动物园管理员')">动物园管理员</li>
<li class="list-group-item" onclick="selectCategory('志愿者')">志愿者</li>
<li class="list-group-item" onclick="selectCategory('艺术家')">艺术家</li>
<li class="list-group-item" onclick="selectCategory('司机')">司机</li>
<li class="list-group-item" onclick="selectCategory('护士')">护士</li>
<li class="list-group-item" onclick="selectCategory('老师')">老师</li>
<li class="list-group-item" onclick="selectCategory('销售人员')">销售人员</li>
<li class="list-group-item" onclick="selectCategory('快递员')">快递员</li>
<li class="list-group-item" onclick="selectCategory('校长')">校长</li>
</ul>
<script>
function selectCategory(category) {
const categories = document.getElementsByClassName("category");
for (let i = 0; i < categories.length; i++) {
categories[i].style.display = "none";
}
categories[category].style.display = "block";
}
</script>