Menu
CoddyTech

侧边栏内容

Coddy 侧边栏|前端项目 课程的第 9 课,共 13 课。

challenge icon

挑战

简单

目标是类 'sidebar' 中的段落元素:

1. 设置颜色(不能是白色)。

2. 按照你的选择添加内边距。

3. 将光标设置为 pointer。

4. 添加悬停效果,将不透明度设置为你选择的值(不能是 1)。

亲手试试

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="styles.css">
    <title>Sidebar</title>
</head>
    <body>
        <button id="openSidebarBtn">Open</button>
        <div id="sidebar" class="sidebar">
            <button id="closeSidebarBtn">Close</button>
            <p>Home</p>
            <p>About</p>
            <p>Services</p>
            <p>Contact</p>
        </div>
        <script src="script.js"></script>
    </body>
</html>

侧边栏|前端项目中的所有课

自己练习: Web 在线编辑器