diff --git a/sources/tech/20220813 Level up your HTML document with CSS.md b/sources/tech/20220813 Level up your HTML document with CSS.md deleted file mode 100644 index dcc57ba2ed..0000000000 --- a/sources/tech/20220813 Level up your HTML document with CSS.md +++ /dev/null @@ -1,280 +0,0 @@ -[#]: subject: "Level up your HTML document with CSS" -[#]: via: "https://opensource.com/article/22/8/css-html-project-documentation" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lkxed" -[#]: translator: "XiaotingHuang22" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Level up your HTML document with CSS -====== -Use CSS to bring style to your HTML project documentation. - -When you write documentation, whether that's for an open source project or a technical writing project, you should have two goals: The document should be written well, and the document should be easy to read. The first is addressed by clear writing skills and technical editing. The second can be addressed with a few simple changes to an HTML document. - -HyperText Markup Language, or HTML, is the backbone of the internet. Since the dawn of the "World Wide Web" in 1994, every web browser uses HTML to display documents and websites. And for almost as long, HTML has supported the *stylesheet*, a special addition to an HTML document that defines how the text should appear on the screen. - -You can write project documentation in plain HTML, and that gets the job done. However, plain HTML styling may feel a little spartan. Instead, try adding a few simple styles to an HTML document to add a little pizzazz to documentation, and make your documents clearer and easier to read. - -### Defining an HTML document - -Let's start with a plain HTML document and explore how to add styles to it. An empty HTML document contains the definition at the top, followed by an block to define the document itself. Within the element, you also need to include a document header that contains metadata about the document, such as its title. The contents of the document body go inside a
block within the parent block. - -You can define a blank page with this HTML code: - -``` - - - - for paragraphs, and and for bold and italic text. Let's pick up where we left off with that article:
-
-```
-
-
-
- Simple Senet
- How to Play
-
-
The game will automatically "throw" the throwing sticks - for you, and display the results in the lower-right corner - of the screen.
- -If the "throw" is zero, then you lose your turn.
- -When it's your turn, the game will automatically select - your first piece on the board. You may or may not be - able to make a move with this piece, so select your piece - to move, and hit Space (or Enter) to move - it. You can select using several different methods:
- -To quit the game at any time, press Q (uppercase - Q) or hit Esc, and the game will prompt if you want - to forfeit the game.
- -You win if you move all of your pieces off the board - before your opponent. It takes a combination of luck and - strategy!
- - -``` - -This HTML document demonstrates a few common block and inline elements used by technical writers who write with HTML. Block elements define a rectangle around text. Paragraphs and headings are examples of block elements, because they extend from the left to the right edges of the document. For example,encloses an invisible rectangle around a paragraph. In contrast, inline elements follow the text where they are used. If you use on some text within a paragraph, only the text surrounded by and becomes bold. - -You can apply direct styling to this document to change the font, colors, and other text styles, but a more efficient way to modify the document's appearance is to apply a *stylesheet* to the document itself. You can do that in the element, with other metadata. You can reference a file for the style sheet, but for this example, use a - - - ... - - -``` - -### Defining styles - -Since you're just starting to learn about stylesheets, let's demonstrate a basic style: background color. I like to start with the background color because it helps to demonstrate block and inline elements. Let's apply a somewhat gaudy stylesheet that sets a *light blue* background color for all
paragraphs, and a *light green* background for the
and
The game will automatically "throw" the throwing sticks - for you, and display the results in the lower-right corner - of the screen.
- -If the "throw" is zero, then you lose your turn.
- -When it's your turn, the game will automatically select - your first piece on the board. You may or may not be - able to make a move with this piece, so select your piece - to move, and hit Space (or Enter) to move - it. You can select using several different methods:
- -To quit the game at any time, press Q (uppercase - Q) or hit Esc, and the game will prompt if you want - to forfeit the game.
- -You win if you move all of your pieces off the board - before your opponent. It takes a combination of luck and - strategy!
- - -``` - -When viewed on a web browser, you see your Readme document in a sans-serif font, with serif fonts for the heading and subheading. The page title is centered. The bold and italics text use a slightly different color that calls the reader's attention without being distracting. Finally, your list items have extra space around them, making each item easier to read. - -![By adding a few styles, we've made this Readme much easier to read.][4] - -This is a simple introduction to using styles in technical writing. Having mastered the basics, you might be interested in [Mozilla's HTML Guide][5]. This includes some great beginner's tutorials so you can learn how to create your own web pages. - -For more information on how CSS styling works, I recommend [Mozilla's CSS Guide][6]. - -Image by: (Jim Hall, CC BY-SA 4.0) - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/8/css-html-project-documentation - -作者:[Jim Hall][a] -选题:[lkxed][b] -译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/painting_computer_screen_art_design_creative.png -[2]: https://opensource.com/article/22/8/writing-project-documentation-html -[3]: https://opensource.com/sites/default/files/2022-08/style-html-1.png -[4]: https://opensource.com/sites/default/files/2022-08/style-html-2.png -[5]: https://developer.mozilla.org/en-US/docs/Web/HTML -[6]: https://developer.mozilla.org/en-US/docs/Web/CSS diff --git a/translated/tech/20220813 Level up your HTML document with CSS.md b/translated/tech/20220813 Level up your HTML document with CSS.md new file mode 100644 index 0000000000..455ea5497c --- /dev/null +++ b/translated/tech/20220813 Level up your HTML document with CSS.md @@ -0,0 +1,270 @@ +[#]: subject: "Level up your HTML document with CSS" +[#]: via: "https://opensource.com/article/22/8/css-html-project-documentation" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +让 CSS 升级你的 HTML 文档 +====== +使用 CSS 让你的 HTML 项目更具风格。 + +当你编写文档时,无论是为开源项目还是技术写作项目,你都应该有两个目标:文档应该写得好,同时要易于阅读。 前者通过清晰的写作技巧和技术编辑来解决。第二个目标可以通过对 HTML 文档进行一些简单的更改来解决。 + +超文本标记语言或 HTML 是互联网的支柱。 自 1994 年“万维网”问世以来,所有网络浏览器都使用 HTML 来显示文档和网站。 几乎与此同时,HTML 一直支持 *stylesheet*,它是对 HTML 文档的一种特殊添加,用于定义文本在屏幕上的呈现方式。 + +单纯用 HTML 编写项目文档你也可以完成工作。 然而,纯 HTML 样式可能感觉有点简陋。 因此,尝试向 HTML 文档添加一些简单的样式,为文档添加一点活力,并使文档更清晰、更易于阅读。 + +### 定义一个 HTML 文档 + +让我们从一个纯 HTML 文档开始,探索如何向其添加样式。 一个空的 HTML 文档在顶部包含 定义,后面跟着一个 块来定义文档本身。 在 元素中,你还需要加上一个文档标头,其中包含有关文档的元数据,例如标题。 文档正文的内容放在父 块内的 块中。 + +你可以使用以下 HTML 代码定义一个空白页面: + +``` + + + + 用于段落, 和 用于粗体和斜体文本。 让我们从那篇文章结束的地方继续讲:
+
+```
+
+
+
+ 简易 Senet
+ 游戏玩法
+
+
游戏会自动为你“投掷”投掷棒,并在屏幕右下角显示结果。
+ +如果“投掷”结果为零,你失去本轮机会。
+ +轮到你的时候,游戏会自动选择 + 你在棋盘上的第一块棋子。 你不一定 + 能够用这个棋子走棋,所以选择你的棋子 + 移动,然后按 Space(或 Enter)移动 + 它。 你可以通过几种不同的方法进行选择:
+ +要随时退出游戏,请按 Q(大写 + Q)或按 Esc,这样游戏会提示你是否想要 + 放弃比赛。
+ +如果你比对手更快将所有棋子移出棋盘,你就赢得了比赛。 + 这同时需要运气和游戏策略!
+ + +``` + +此 HTML 文档演示了利用 HTML 的技术写作者经常使用的一些块和内联元素。 块元素在围绕文本定义一个矩形。 段落和标题是块元素的示例,因为它们从文档的左边缘延伸到右边缘。 例如,在段落周围包含一个不可见的矩形。 相比之下,内联元素的使用则紧跟在它们包围的文本。 如果你在段落中的某些文本上使用 ,则只有被 和 包围的文本会变为粗体。 + +You can apply direct styling to this document to change the font, colors, and other text styles, but a more efficient way to modify the document's appearance is to apply a *stylesheet* to the document itself. You can do that in the element, with other metadata. You can reference a file for the style sheet, but for this example, use a + + + ... + + +``` + +### 定义样式 + +由于你刚刚开始学习样式表,因此这里先演示一种基本样式:背景色。 我喜欢从背景颜色开始,因为它有助于演示块和内联元素。 让我们应用一个有点华丽的样式表,为所有
段落设置*浅蓝色*背景颜色,为
和
游戏会自动为你“投掷”投掷棒,并在屏幕右下角显示结果。
+ +如果“投掷”结果为零,你失去本轮机会。
+ +轮到你的时候,游戏会自动选择 + 你在棋盘上的第一块棋子。 你不一定 + 能够用这个棋子走棋。所以选择你的棋子 + 移动,然后按 Space(或 Enter)移动 + 它。 你可以通过几种不同的方法进行选择:
+ +要随时退出游戏,请按 Q(大写 + Q)或按 Esc,这样游戏会提示你是否想要 + 放弃比赛。
+ +如果你比对手更快将所有棋子移出棋盘,你就赢得了比赛。 + 这同时需要运气和游戏策略!
+ + +``` + +在网页浏览器上查看时,你会看到采用无衬线字体的自述文件,标题和副标题使用衬线字体。 页面标题居中。 粗体和斜体文本使用略有不同的颜色来吸引读者的注意力而不会分散注意力。 最后,列表项周围有额外的空间,使每个项目更易于阅读。 + +![通过添加一些样式,我们使这个自述文件更易于阅读。][4] + +这是在技术写作中使用样式的简单介绍。 掌握了基础知识后,你可能会对 [Mozilla 的 HTML 指南][5] 感兴趣。 它包括一些很棒的初学者教程,因此你可以学习如何创建自己的网页。 + +有关 CSS 样式的更多信息,我推荐 [Mozilla 的 CSS 指南][6]。 + +图片来自: (Jim Hall, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/css-html-project-documentation + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/painting_computer_screen_art_design_creative.png +[2]: https://opensource.com/article/22/8/writing-project-documentation-html +[3]: https://opensource.com/sites/default/files/2022-08/style-html-1.png +[4]: https://opensource.com/sites/default/files/2022-08/style-html-2.png +[5]: https://developer.mozilla.org/en-US/docs/Web/HTML +[6]: https://developer.mozilla.org/en-US/docs/Web/CSS