feat: Add CSS layout exercises and corresponding HTML files

- Created multiple exercises under the CSS layout section, including:
  - Final page layout with CSS styles and HTML structure.
  - Display and flow concepts with examples of block, inline, and none display types.
  - Selectors and pseudo-classes with practical examples.
  - Overflow and sizing handling in CSS.
  - Grid layout basics for two-dimensional layouts.
  - Fixed and sticky positioning examples.
  - Centering techniques for common layout scenarios.

- Added README files for each exercise to outline objectives and file structures.
- Updated main README to include new sections and usage instructions.
This commit is contained in:
chali
2026-03-09 14:16:22 +08:00
commit 4495ae0e28
85 changed files with 2566 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
# 练习 2文本、链接、列表
## 目标
掌握最常见的内容组织标签。
## 你要练什么
- `h1``h3`
- `p`
- `strong`
- `em`
- `a`
- `ul` / `ol` / `li`
## 任务
请完成一个“前端新手资源页”,要求包含:
- 一个主标题
- 一个资源介绍段落,段落中要有 `strong``em`
- 一个“推荐网站”二级标题
- 一个无序列表,里面至少 3 个链接
- 一个“学习步骤”二级标题
- 一个有序列表,里面至少 4 步
## 检查点
- `a` 是否有 `href`
- 列表项是否全部在 `li`
- 强调内容是否使用了合适标签
- 标题层级是否合理
## 文件
- [starter.html](/Volumes/Macintosh HD 1/home/front-end-example/01-html-structure/02-text-links-lists/starter.html)
- [answer.html](/Volumes/Macintosh HD 1/home/front-end-example/01-html-structure/02-text-links-lists/answer.html)

View File

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>前端新手资源页</title>
</head>
<body>
<h1>前端新手资源页</h1>
<p>
学习前端时,最重要的是先把 <strong>HTML 结构</strong> 打稳,再逐步进入
<em>CSS 布局</em> 和 JavaScript 交互。
</p>
<h2>推荐网站</h2>
<ul>
<li><a href="https://developer.mozilla.org/" target="_blank">MDN Web Docs</a></li>
<li><a href="https://www.w3schools.com/" target="_blank">W3Schools</a></li>
<li><a href="https://html.spec.whatwg.org/" target="_blank">HTML Standard</a></li>
</ul>
<h2>学习步骤</h2>
<ol>
<li>先掌握 HTML 页面骨架</li>
<li>练习文本、链接和列表结构</li>
<li>开始写语义化页面布局</li>
<li>再进入表格和表单练习</li>
</ol>
</body>
</html>

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>前端新手资源页</title>
</head>
<body>
<!-- 任务:
1. 写一个主标题
2. 写一个介绍段落,包含 strong 和 em
3. 写一个推荐网站区域,包含 ul 和多个 a
4. 写一个学习步骤区域,包含 ol
-->
</body>
</html>