侧边栏 - III
Coddy 侧边栏|前端项目 课程的第 8 课,共 13 课。
挑战
简单目标类 'sidebar':
1. 将 x 方向的 overflow 设置为 hidden。
2. 将 transition 的时长设置为 0.5s。
3. 添加任意大小的内边距。
亲手试试
<!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 在线编辑器