Menu
CoddyTech

输入

Coddy 图片折叠面板:前端项目 课程的第 16 课,共 17 课。

challenge icon

挑战

简单

目标 input 标签: 

  1. 将 display 设置为 none。

重要: 在末尾添加这段代码,这样点击任意 input 后,过渡文本就会显示出来,并且点击后 label 会占据相应的宽度:

input:checked + label {
    width: 600px;
}

input:checked + label .description {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

亲手试试

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="styles.css">
</head>
    <body>
        <!-- 在这里编写 HTML 代码 -->
        <script src="script.js"></script>
    </body>
</html>

图片折叠面板:前端项目中的所有课

自己练习: Web 在线编辑器