├── .editorconfig ├── .gitignore ├── CNAME ├── LICENSE.md ├── README.md ├── _config.yml ├── _includes ├── banner.html ├── carbon.html ├── facebook.html ├── footer.html ├── head.html ├── header.html ├── newsletter.html ├── scripts.html ├── share.html └── table-of-contents.html ├── _layouts ├── chapter.html ├── default.html └── post.html ├── _posts ├── 2015-01-01-introduction.md ├── 2015-01-02-internet.md ├── 2015-01-03-web.md ├── 2015-01-04-browser.md ├── 2015-01-05-requirements.md ├── 2015-02-01-html-basics.md ├── 2015-02-02-html-syntax.md ├── 2015-02-03-html-block-inline.md ├── 2015-02-04-html-hierarchy.md ├── 2015-02-05-html-semantics.md ├── 2015-02-06-html-formatting.md ├── 2015-02-07-html-valid-document.md ├── 2015-03-01-html-content.md ├── 2015-03-02-html-text.md ├── 2015-03-03-html-inline-semantics.md ├── 2015-03-03-html-links.md ├── 2015-03-04-html-images.md ├── 2015-03-05-html-tables.md ├── 2015-03-06-html-structure.md ├── 2015-03-07-html-forms.md ├── 2015-04-01-css-basics.md ├── 2015-04-02-why-css-exists.md ├── 2015-04-03-css-syntax.md ├── 2015-04-04-css-selectors.md ├── 2015-04-05-css-inheritance.md ├── 2015-04-06-css-priority.md ├── 2015-04-07-css-color-units.md ├── 2015-04-08-css-size-units.md ├── 2015-04-09-css-reset.md ├── 2015-05-01-css-text.md ├── 2015-05-02-css-font-family.md ├── 2015-05-03-css-font-size-style-weight.md ├── 2015-05-04-css-line-height.md ├── 2015-05-05-css-font-shorthand.md ├── 2015-05-06-css-text-properties.md ├── 2015-06-01-css-box-model.md ├── 2015-06-02-css-background.md ├── 2015-06-03-css-display.md ├── 2015-06-04-css-height-width-overflow.md ├── 2015-06-05-css-border.md ├── 2015-06-06-css-padding.md ├── 2015-06-07-css-margin.md ├── 2015-06-08-css-size-shorthand-wheel.md ├── 2015-07-01-css-positioning.md ├── 2015-07-02-css-the-flow.md ├── 2015-07-03-css-position.md ├── 2015-07-04-css-float-clear.md ├── 2015-08-01-css-advanced.md ├── 2015-08-02-css-pseudo-classes.md ├── 2015-08-03-css-gradients.md ├── 2015-08-04-css-transitions.md ├── 2015-08-05-css-animations.md ├── 2015-08-06-css-transform.md ├── 2015-08-07-css-responsiveness.md ├── 2015-09-01-sass.md ├── 2015-09-02-sass-scss-less.md ├── 2015-09-03-sass-variables.md ├── 2015-09-04-sass-nesting.md ├── 2015-09-05-sass-mixins.md └── 2015-09-06-sass-extend.md ├── _sass ├── base.sass ├── bourbon │ ├── _bourbon-deprecated-upcoming.scss │ ├── _bourbon.scss │ ├── addons │ │ ├── _border-color.scss │ │ ├── _border-radius.scss │ │ ├── _border-style.scss │ │ ├── _border-width.scss │ │ ├── _buttons.scss │ │ ├── _clearfix.scss │ │ ├── _ellipsis.scss │ │ ├── _font-stacks.scss │ │ ├── _hide-text.scss │ │ ├── _margin.scss │ │ ├── _padding.scss │ │ ├── _position.scss │ │ ├── _prefixer.scss │ │ ├── _retina-image.scss │ │ ├── _size.scss │ │ ├── _text-inputs.scss │ │ ├── _timing-functions.scss │ │ ├── _triangle.scss │ │ └── _word-wrap.scss │ ├── css3 │ │ ├── _animation.scss │ │ ├── _appearance.scss │ │ ├── _backface-visibility.scss │ │ ├── _background-image.scss │ │ ├── _background.scss │ │ ├── _border-image.scss │ │ ├── _calc.scss │ │ ├── _columns.scss │ │ ├── _filter.scss │ │ ├── _flex-box.scss │ │ ├── _font-face.scss │ │ ├── _font-feature-settings.scss │ │ ├── _hidpi-media-query.scss │ │ ├── _hyphens.scss │ │ ├── _image-rendering.scss │ │ ├── _keyframes.scss │ │ ├── _linear-gradient.scss │ │ ├── _perspective.scss │ │ ├── _placeholder.scss │ │ ├── _radial-gradient.scss │ │ ├── _selection.scss │ │ ├── _text-decoration.scss │ │ ├── _transform.scss │ │ ├── _transition.scss │ │ └── _user-select.scss │ ├── functions │ │ ├── _assign-inputs.scss │ │ ├── _contains-falsy.scss │ │ ├── _contains.scss │ │ ├── _is-length.scss │ │ ├── _is-light.scss │ │ ├── _is-number.scss │ │ ├── _is-size.scss │ │ ├── _modular-scale.scss │ │ ├── _px-to-em.scss │ │ ├── _px-to-rem.scss │ │ ├── _shade.scss │ │ ├── _strip-units.scss │ │ ├── _tint.scss │ │ ├── _transition-property-name.scss │ │ └── _unpack.scss │ ├── helpers │ │ ├── _convert-units.scss │ │ ├── _directional-values.scss │ │ ├── _font-source-declaration.scss │ │ ├── _gradient-positions-parser.scss │ │ ├── _linear-angle-parser.scss │ │ ├── _linear-gradient-parser.scss │ │ ├── _linear-positions-parser.scss │ │ ├── _linear-side-corner-parser.scss │ │ ├── _radial-arg-parser.scss │ │ ├── _radial-gradient-parser.scss │ │ ├── _radial-positions-parser.scss │ │ ├── _render-gradients.scss │ │ ├── _shape-size-stripper.scss │ │ └── _str-to-num.scss │ └── settings │ │ ├── _asset-pipeline.scss │ │ ├── _prefixer.scss │ │ └── _px-to-em.scss ├── buttons.sass ├── chapter.sass ├── components.sass ├── controls.sass ├── elements.sass ├── functions.sass ├── index.sass ├── pygments-monokai-extended.sass ├── reset.sass └── variables.sass ├── css ├── ie.css ├── main.sass ├── reset.css └── tutorial.css ├── favicon.ico ├── html ├── sample-paragraph.html └── visited.html ├── images ├── @1x │ ├── button-start-reading.png │ └── toc-head.png ├── button-start-reading.png ├── device-browser-viewport.png ├── frog.jpg ├── hsl-model.png ├── image-density-in-css.png ├── marksheet-banner.png ├── marksheet-free-html-css-tutorial.png ├── marksheet-hello.png ├── marksheet-icon.png ├── marksheet-logo.png ├── original │ ├── marksheet-free-html-css-tutorial.png │ └── marksheet-hello.png ├── pattern.png ├── photoshop-color-picker.png ├── solar-eclipse.jpg ├── soyuz-spacecraft.jpg ├── text-editors │ ├── notepad-plus-plus.png │ └── sublime-text.png ├── toc-head.png └── web-browsers │ ├── chrome.png │ ├── firefox.png │ ├── internet-explorer.png │ ├── opera.png │ └── safari.png ├── index.html ├── javascript ├── affix.js ├── codemirror.js ├── d3.min.js ├── index.js ├── jquery-1.11.1.min.js ├── marksheet.js ├── mode │ ├── css │ │ ├── css.js │ │ ├── index.html │ │ ├── less.html │ │ ├── less_test.js │ │ ├── scss.html │ │ ├── scss_test.js │ │ └── test.js │ ├── htmlmixed │ │ ├── htmlmixed.js │ │ └── index.html │ └── xml │ │ ├── index.html │ │ ├── test.js │ │ └── xml.js └── post.js ├── original-docs ├── 2015-01-01-introduction.md ├── 2015-01-02-internet.md ├── 2015-01-03-web.md ├── 2015-01-04-browser.md ├── 2015-01-05-requirements.md ├── 2015-02-01-html-basics.md ├── 2015-02-02-html-syntax.md ├── 2015-02-03-html-block-inline.md ├── 2015-02-04-html-hierarchy.md ├── 2015-02-05-html-semantics.md ├── 2015-02-06-html-formatting.md ├── 2015-02-07-html-valid-document.md ├── 2015-03-01-html-content.md ├── 2015-03-02-html-text.md ├── 2015-03-03-html-inline-semantics.md ├── 2015-03-03-html-links.md ├── 2015-03-04-html-images.md ├── 2015-03-05-html-tables.md ├── 2015-03-06-html-structure.md ├── 2015-03-07-html-forms.md ├── 2015-04-01-css-basics.md ├── 2015-04-02-why-css-exists.md ├── 2015-04-03-css-syntax.md ├── 2015-04-04-css-selectors.md ├── 2015-04-05-css-inheritance.md ├── 2015-04-06-css-priority.md ├── 2015-04-07-css-color-units.md ├── 2015-04-08-css-size-units.md ├── 2015-04-09-css-reset.md ├── 2015-05-01-css-text.md ├── 2015-05-02-css-font-family.md ├── 2015-05-03-css-font-size-style-weight.md ├── 2015-05-04-css-line-height.md ├── 2015-05-05-css-font-shorthand.md ├── 2015-05-06-css-text-properties.md ├── 2015-06-01-css-box-model.md ├── 2015-06-02-css-background.md ├── 2015-06-03-css-display.md ├── 2015-06-04-css-height-width-overflow.md ├── 2015-06-05-css-border.md ├── 2015-06-06-css-padding.md ├── 2015-06-07-css-margin.md ├── 2015-06-08-css-size-shorthand-wheel.md ├── 2015-07-01-css-positioning.md ├── 2015-07-02-css-the-flow.md ├── 2015-07-03-css-position.md ├── 2015-07-04-css-float-clear.md ├── 2015-08-01-css-advanced.md ├── 2015-08-02-css-pseudo-classes.md ├── 2015-08-03-css-gradients.md ├── 2015-08-04-css-transitions.md ├── 2015-08-05-css-animations.md ├── 2015-08-06-css-transform.md ├── 2015-08-07-css-responsiveness.md ├── 2015-09-01-sass.md ├── 2015-09-02-sass-scss-less.md ├── 2015-09-03-sass-variables.md ├── 2015-09-04-sass-nesting.md ├── 2015-09-05-sass-mixins.md └── 2015-09-06-sass-extend.md └── thank-you.html /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | _config.yml 3 | .sass-cache 4 | _site -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | learn.escript.cn 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jeremy Thomas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## [HTML、CSS 系列教程](http://fe-primary-tutorial.yangxiaofu.com/) 2 | 3 | 4 | 本教程主要为 [Marksheet](http://marksheet.io) 的中文翻译版,并在此基础上进行修正,以更方便中文读者进行学习。 5 | * 原文 github: [https://github.com/jgthms/marksheet](https://github.com/jgthms/marksheet) 6 | 7 | ## 如何参与翻译 8 | 9 | 1. fork 10 | 2. clone 到本地 11 | 3. update readme, 添加认领标识 12 | 4. 提交 PR 13 | 14 | ## 翻译认领(`/posts`目录) 15 | 16 | * introduction.md - @yangxiaofu - 翻译中 17 | * internet.md - @yangxiaofu - 翻译中 18 | * web.md - @yangxiaofu - 翻译中 19 | * browser.md - @xiaowang - 完成 20 | * HTML Basic - @fanmingfei - 完成 21 | * HTML Syntax - @fanmingfei - 完成 22 | * HTML Block and Inline - @fanmingfei - 完成 23 | * HTML Hierarchy - @fanmingfei - 完成 24 | * HTML Semantics - @liuchunhui - 完成 25 | * HTML Formatting - @fanmingfei - 完成 26 | * HTML Valid Document -@fanmingfei -完成 27 | * HTML Text - @fanmingfei - 完成 28 | * HTML Inline Semantics - @fanmingfei - 完成 29 | * HTML Links - @melanc - 完成 30 | * HTML Images - @fanmingfei - 完成 31 | * HTML Tables - @fanmingfei - 完成 32 | * HTML Structure - @fanmingfei - 完成 33 | * HTML Forms - @fanmingfei - 完成 34 | * CSS Basics - @fanmingfei -完成 35 | * Why CSS Exists - @fanmingfei - 完成 36 | * CSS Syntax - @xiaowang - 完成 37 | * CSS Selectors - @xiaowang - 翻译中 38 | * CSS Inheritance - @fanmingfei - 完成 39 | * CSS Priority - @fanmingfei - 完成 40 | * CSS Size Unit - @fanmingfei - 完成 41 | * CSS Reset - @fanmingfei - 完成 42 | * CSS Text - @fanmingfei - 完成 43 | * CSS Font Family - @fanmingfei - 完成 44 | * CSS Font Size Style Weight - @fanmingfei - 完成 45 | * CSS Line Height - @fanmingfei - 完成 46 | 47 | ## License 48 | 49 | 50 | * MIT 51 | 52 | * 遵循创意共享4.0协议: [http://creativecommons.org/licenses/by-nc-sa/4.0/](http://creativecommons.org/licenses/by-nc-sa/4.0/) 53 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | name: fe-primary-tutorial 2 | description: A free tutorial to learn HTML and CSS 3 | markdown: kramdown 4 | kramdown: 5 | input: GFM 6 | exclude: ['images/original'] 7 | permalink: :title.html 8 | baseurl: fe-primary-tutorial -------------------------------------------------------------------------------- /_includes/banner.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /_includes/carbon.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /_includes/facebook.html: -------------------------------------------------------------------------------- 1 | {% if page.layout == 'index' %} 2 |
3 | {% endif %} 4 | -------------------------------------------------------------------------------- /_includes/footer.html: -------------------------------------------------------------------------------- 1 | 30 | -------------------------------------------------------------------------------- /_includes/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ page.title | strip_html }} - 前端学习教程 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /_includes/header.html: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /_includes/newsletter.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 | 8 |

9 | MarkSheet Video tutorials are coming! 10 |

11 |

12 | Sign up for the MarkSheet newsletter to get notified! 13 |

14 |
15 | 16 |
17 |
18 | 19 |
20 |
21 | 22 | 23 |
24 | 25 | 26 | 27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /_includes/scripts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% if page.layout == 'post' %} 9 | 10 | 11 | {% endif %} 12 | 13 | 16 | 17 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /_includes/share.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
Like
7 |
8 |
9 | -------------------------------------------------------------------------------- /_layouts/chapter.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | route: chapter 4 | --- 5 | 6 |
7 |
8 |
9 |

10 | {{ page.date | date: "%m.%-d" | remove_first: '0' }} 11 | {{ page.title }} 12 |

13 |

{{ page.subtitle }}

14 |
15 |
16 | 17 |
18 |
19 |
20 | {{ content }} 21 |
22 | 23 | 31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 |
6 |
7 |
8 | Fork me on GitHub 9 |
10 | {{ content }} 11 |
12 | {% include scripts.html %} 13 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | route: post 4 | --- 5 | 6 |
7 |
8 |
9 |

10 | {{ page.date | date: "%m.%-d" | remove_first: '0' }} 11 | {{ page.title }} 12 |

13 |

{{ page.subtitle }}

14 |
15 |
16 | 17 |
18 |
19 | 56 | 57 | 60 | 61 |
62 | {{ content }} 63 |
64 | 65 | 80 |
81 |
82 |
83 | 84 | 85 | 86 | Back to top 87 | 88 | -------------------------------------------------------------------------------- /_posts/2015-01-01-introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: chapter 3 | title: "简介" 4 | subtitle: "简单的介绍 Web 的工作原理" 5 | section: web 6 | --- 7 | 8 | 在正式开始学习和代码实战之前,你应该要对整个 web 的工作原理有一个基本的了解。 9 | 10 | 本课程将会从因特网和 web 两个点来带你快速的理解整个网络系统。 11 | 12 | -------------------------------------------------------------------------------- /_posts/2015-01-05-requirements.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "Requirements" 4 | subtitle: "Before reading this tutorial" 5 | section: web 6 | published: false 7 | --- 8 | 9 | ### Show file extensions 10 | 11 | Let's say you have a solar eclipse picture on your computer, it will show up as: 12 | 13 | ![Solar Eclipse](/images/solar-eclipse.jpg) 14 | 15 | * the **name** of the file is `solar-eclipse` 16 | * the **extension** of the file is `.jpg` 17 | 18 | A file's extension defines the _type_ of file it is (in this case, an image). For HTML files, the extension is `.html`. 19 | 20 | By default, **file extensions** are hidden. In this tutorial, we'll need to be able to edit these extensions. So follow these instructions to display file extensions: 21 | 22 | * **Windows**: [Show or hide file name extensions](http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions) 23 | * **Mac**: [Show and hide filename extensions](https://support.apple.com/kb/PH10845?locale=en_US) 24 | 25 | ### Download a good Web browser 26 | 27 | 28 | 29 | [^1]: ["March 20th Eclipse - Ireland cropped" by Jacob Thomas](http://commons.wikimedia.org/wiki/File:March_20th_Eclipse_-_Ireland_cropped.jpg#/media/File:March_20th_Eclipse_-_Ireland_cropped.jpg) 30 | -------------------------------------------------------------------------------- /_posts/2015-02-01-html-basics.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: chapter 3 | title: "HTML 基础" 4 | subtitle: "HTML is like Word but for the Web" 5 | section: html 6 | --- 7 | 8 | 9 | 10 | 你肯定非常了解一些文档编辑工具,比如Microsoft Word,你可以在word里实现文档内容的各种样式,比如标题、段落、列表、表格、图片、字体加粗等。 11 | 12 | **HTML**为你提供了一系列元素来控制样式。与Microsoft Word不一样的是,Microsoft Word 是可视化的,而HTML 代码是纯_语义化_的:你要赋予你的文本一定的意义。 13 | 14 | 你可以用 音符 ♫ ♬ 来创作**音乐**,也可以用 **HTML** 来设计 **网页**。 -------------------------------------------------------------------------------- /_posts/2015-02-02-html-syntax.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "HTML 语法" 4 | subtitle: "As any language, HTML has rules" 5 | section: html 6 | --- 7 | 8 | **HTML** **H**yper**T**ext **M**arkup **L**anguage:(超文本标记语言) 9 | 10 | * **超文本(HyperText)** 代表着它通过HTTP协议在网络上传输 11 | * **标记(Markup)** 代表着它的代码是一些可以解释的关键词 12 | * **语言(Language)** 代表它可以被人和机器阅读 13 | 14 | HTML 有一套相对于其它语言更简单的规则,HTML通过**边界**来区别什么时候开始和结束。 15 | 16 | 17 | 以下是一个简单的代表段落的HTML代码: 18 | 19 | {% highlight html %} 20 |

这是一个段落,一般我们将段落写在p标签内。

21 | {% endhighlight %} 22 | 23 |

这是一个段落,一般我们将段落写在p标签内。

24 | 25 | 上面的尖括号`<`{:.language-html} 和 `>`{:.language-html} 就是HTML标签,它定义网页内一些内容的开始和结束。 26 | 27 | 每一个标签都有明确的**意义**,比如说上面这个例子`p`{:.language-html}代表着 **段落**。 28 | 29 | 30 | 标签通常成对出现: 31 | 32 | * 开始标签 `

`{:.language-html} 定义段落的**开始** 33 | * 闭合标签 `

`{:.language-html} 定义段落的**闭合** 34 | 35 | 开始标签和闭合标签的书写区别在于,闭合标签的标签名前带一个`/`{:.language-html}。 36 | 37 | 如果你用开始标签和闭合标签包含了一些内容,你将获得一个**HTML 元素**。上面的例子就是通过`

`{:.language-html}和`

`{:.language-html}创建了一个HTML 元素。 38 | 39 | 你可以 [在浏览器中查看](/html/sample-paragraph.html)这个例子,你会发现,**HTML标签并没有在页面中显示**。这些标签只用来让浏览器 _识别_ 你写的**内容**的 _类型_。 40 | 41 | ### 在哪里写HTML 42 | 43 | 你肯定写过文本文件,文本文件的后缀名是`.txt`。 44 | 45 | 你可以通过修改后缀名,把`.txt`改为`.html`来创建一个**HTML 文档**。 46 | 47 | 复制下面的内容到你的文本编辑器 48 | 49 | {% highlight html %} 50 |

Hello World!

51 | {% endhighlight %} 52 | 53 | 将它保存为 `my-first-webpage.html` 并且通过浏览器打开它,你可以看到以下内容: 54 | 55 |

Hello World!

56 | 57 | 注意: 58 | * 使用Notepad++、Sublime Text 等文本编辑器来**创建**HTML文档。 59 | * 使用Chrome、Firefox来**打开**HTML文档。 60 | 61 | ### 属性 62 | 63 | 64 | 属性可以给HTML元素附加其它信息,属性写在HTML_标签里面_。当然,HTML属性也不会在浏览器上显示出来。 65 | 66 | 67 | 例子:`href`属性用来给`a`标签定义一个**链接** 68 | 69 | {% highlight html %} 70 | 下载 Firefox 71 | {% endhighlight %} 72 | 73 |
下载 Firefox
74 | 75 | 76 | 这里有[通用HTML属性](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes) 可以被用在任意一个HTML元素上,并且这些属性都是可选的。 77 | 78 | 79 | 我们以后主要会用`class`(用于CSS选择器的名字),`title`(鼠标移入元素后一段时间显示的提示) 80 | 81 | 有些HTML元素**必选**的属性,比如,插入一张图片,你需要使用`src`(资源)属性给元素提供一个图片的地址。 82 | 83 | 84 | {% highlight html %} 85 | 图片的简介 86 | {% endhighlight %} 87 | 88 | 考虑到``元素是用来展示图片的,所以给他指定一个路径是有必要的。 89 | 90 | 91 | 92 | 93 | ### 注释 94 | 95 | 如果你想写一些不需要浏览器展示的内容,可以写使用**注释**。它会被浏览器忽略,这些内容只对编写、查看代码的人有用。 96 | 97 | 98 | 一条注释以``结束。 99 | 100 | {% highlight html %} 101 | 102 |

Hello World!

103 | {% endhighlight %} 104 | 105 | 106 |

Hello World!

107 | 108 | ### 自闭合标签 109 | 110 | 有些HTML元素只有开始标签: 111 | 112 | {% highlight html %} 113 |
114 | Description 115 | 116 | {% endhighlight %} 117 | 118 | 因为自闭合标签没有闭合标签,所以它不能包含其他文档内容,只能通过一些属性来设置额外的信息。 119 | -------------------------------------------------------------------------------- /_posts/2015-02-03-html-block-inline.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "HTML 块级元素内联元素" 4 | subtitle: "HTML has 2 main types of elements" 5 | section: html 6 | --- 7 | 8 | 9 | 10 | 在HTML中,主要有两种HTML元素。 11 | 12 | * **块级** 元素: 13 | 14 | * 段落: `

` 15 | * 列表: 有序列表 `