前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >HTML4.01规范-文本(3)

HTML4.01规范-文本(3)

作者头像
py3study
发布2020-01-14 12:35:50
1.3K0
发布2020-01-14 12:35:50
举报
文章被收录于专栏:python3python3

9.3.5 Visual rendering of paragraphs

Note. The following section is an informative description of the behavior of some current visual user agents when formatting paragraphs. Style sheets allow better control of paragraph formatting.

注释。下面的部分是当前一些可视化用户代理在格式化段落时行为的非正式描述。样式表可以对段落格式化进行更好地控制。

How paragraphs are rendered visually depends on the user agent. Paragraphs are usually rendered flush left with a ragged right margin. Other defaults are appropriate for right-to-left scripts.

段落如何被展现依赖于用户代理。段落通常情况下会从左侧开始并在右侧留有不规整的空白。其他的缺省情况对从右向左的语言也是适用的。

HTML user agents have traditionally rendered paragraphs with white space before and after, e.g.,

代码语言:javascript
复制
HTML用户代理典型情况下会在段落的开始和结束放置空格。例如:

At the same time, there began to take form a system of numbering,   the calendar, hieroglyphic writing, and a technically advanced   art, all of which later influenced other peoples.    

Within the framework of this gradual evolution or cultural   progress the Preclassic horizon has been divided into Lower,   Middle and Upper periods, to which can be added a transitional   or Protoclassic period with several features that would later   distinguish the emerging civilizations of Mesoamerica. 

This contrasts with the style used in novels which indents the first line of the paragraph and uses the regular line spacing between the final line of the current paragraph and the first line of the next, e.g.,

这和在小说里适用的样式是不一样,在小说里每个段落的第一行会缩进以及在段落之间,即当前段落的最后一行和下一段落的第一行之间,的行间距离是正常的,例如:

代码语言:javascript
复制
         At the same time, there began to take form a system of   numbering, the calendar, hieroglyphic writing, and a technically   advanced art, all of which later influenced other peoples.      
    Within the framework of this gradual evolution or cultural   progress the Preclassic horizon has been divided into Lower,   Middle and Upper periods, to which can be added a transitional   or Protoclassic period with several features that would later   distinguish the emerging civilizations of Mesoamerica. 

Following the precedent set by the NCSA Mosaic browser in 1993, user agents generally don't justify both margins, in part because it's hard to do this effectively without sophisticated hyphenation routines. The advent of style sheets, and anti-aliased fonts with subpixel positioning promises to offer richer choices to HTML authors than previously possible.

由于遵从NCSA Mosaic 浏览器的设置,用户代理一般都不会采用两端对齐,部分原因是由于没有丰富的连词符机制而很难做到。样式表以及平滑处理字体的出现给HTML作者提供了比以前更加丰富的控制。

Style sheets provide rich control over the size and style of a font, the margins, space before and after a paragraph, the first line indent, justification and many other details. The user agent's default style sheet renders P elements in a familiar form, as illustrated above. One could, in principle, override this to render paragraphs without the breaks that conventionally distinguish successive paragraphs. In general, since this may confuse readers, we discourage this practice.

样 式表提供了对字体大小以及样式、扉页留白,段落前后的空格,首行缩进,对齐以及其他很多细节信息的丰富控制。用户代理的缺省样式表会像上面提到的形式来展 现P元素。原则上,可以对段落间段落分隔的展现形式作覆盖,将其变成没有段落间折行。一般来说,由于这样做可能会让读者迷惑,我们不推荐这样做。

By convention, visual HTML user agents wrap text lines to fit within the available margins. Wrapping algorithms depend on the script being formatted.

按照约定,可视化HTML用户代理会将行按照适合可用的留白来进行折行。折行机制依赖于格式化的脚本。

In Western scripts, for example, text should only be wrapped at white space. Early user agents incorrectly wrapped lines just after the start tag or just before the end tag of an element, which resulted in dangling punctuation. For example, consider this sentence:

例如:在西方语言中,文本应该只在空格的地方进行折行。早期的用户代理会在元素开始标签之后或者结束标签之前尽心不正确的折行,这可能导致标点符号显示错误。例如,看下面的句子:

代码语言:javascript
复制
   A statue of the <A href="cih78">Cihuateteus</A>, who are patron ...

Wrapping the line just before the end tag of the A element causes the comma to be stranded at the beginning of the next line:

在A元素的结束标签之前进行折行会导致逗号出现在下一行的开始:

代码语言:javascript
复制
  A statue of the Cihuateteus
  
, who are patron ...

This is an error since there was no white space at that point in the markup.

由于在标记语言中该位置没有空格,这样显示是错误的。

9.4 Marking document changes: The INS and DEL elements

代码语言:javascript
复制
<!-- INS/DEL are handled by inclusion on BODY -->

<!ELEMENT (INS|DEL) - - (%flow;)*      -- inserted text, deleted text -->

<!ATTLIST (INS|DEL)

  %attrs;                              -- %coreattrs, %i18n, %events --
cite        %URI;          #IMPLIED  -- info on reason for change --
  
datetime    %Datetime;     #IMPLIED  -- date and time of change --
  >

Start tag: required, End tag: required

开始标签:必须,结束标签:必须

Attribute definitions

属性定义

cite = uri [CT]The value of this attribute is a URI that designates a source document or message. This attribute is intended to point to information explaining why a document was changed 该属性的值是指向一个源文档或者消息的URI。该属性应该试图指向解释为什么文档变化的信息。 datetime = datetime [CS]The value of this attribute specifies the date and time when the change was made 该属性的值指定文档被修改的日期和时间。

Attributes defined elsewhere

在其他地方定义的属性

INS and DEL are used to markup sections of the document that have been inserted or deleted with respect to a different version of a document (e.g., in draft legislation where lawmakers need to view the changes).

INS和DEL用于对文档内插入和删除的内容进行标记,以揭示一个不同版本的文档(例如,在立法草案中立法者需要查看这些改变)。

These two elements are unusual for HTML in that they may serve as either block-level or inline elements (but not both). They may contain one or more words within a paragraph or contain one or more block-level elements such as paragraphs, lists and tables.

在HTML中,这两个元素是不同寻常的,他们既可以被认为是块级别元素也可以是行呢元素。他们既可以包含一个段落里的一个或多个单词,也可以包含一个或多个块级别元素,例如:段落,列表和表格。

This example could be from a bill to change the legislation for how many deputies a County Sheriff can employ from 3 to 5.

下的的例子来自对一个州可以拥有的雇员数的修订,将原来的3个雇员修订为5个。

代码语言:javascript
复制
<P>
  A Sheriff can employ <DEL>3</DEL><INS>5</INS> deputies.
</P>

The INS and DEL elements must not contain block-level content when these elements behave as inline elements.

INS和DEL元素在其作为行内元素时不能包含任何块级别内容。

ILLEGAL EXAMPLE:

非法示例: The following is not legal HTML.

下面的HTML是非法的。

代码语言:javascript
复制
<P>

<INS>
<DIV>
 ...block-level content...
</DIV>
</INS>

</P>

User agents should render inserted and deleted text in ways that make the change obvious. For instance, inserted text may appear in a special font, deleted text may not be shown at all or be shown as struck-through or with special markings, etc.

用户代理应该以显著的方式来展现插入的以及删除的文本。例如,插入的文本可以采用特殊的字体,删除的文本可以不显示或者以删除线亦或者用特殊的标记等。

Both of the following examples correspond to November 5, 1994, 8:15:30 am, US Eastern Standard Time.

下面的两个例子都是美国东部标准时间 1994年11月5日,上午8时15分30秒。

代码语言:javascript
复制
     1994-11-05T13:15:30Z 
     1994-11-05T08:15:30-05:00 

Used with INS, this gives:

和INS一起使用将是:

代码语言:javascript
复制
<INS datetime="1994-11-05T08:15:30-05:00"         cite="http://www.foo.org/mydoc/comments.html"> Furthermore, the latest figures from the marketing department suggest that such practice is on the rise. </INS>

The document "http://www.foo.org/mydoc/comments.html" would contain comments about why information was inserted into the document.

文档"http://www.foo.org/mydoc/comments.html"将包含信息被插入到文档内原因的注释。

Authors may also make comments about inserted or deleted text by means of the title attribute for the INS and DEL elements. User agents may present this information to the user (e.g., as a popup note). For example:

对于INS和DEL元素,作者也可以用title属性来为插入和删除的文本做注释。用户代理会将信息展示给用户(例如,作为弹出提示)。例如:

代码语言:javascript
复制
<INS datetime="1994-11-05T08:15:30-05:00"
        title="Changed as a result of Steve B's comments in meeting.">
Furthermore, the latest figures from the marketing department
suggest that such practice is on the rise.
</INS>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-07-03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 9.3.5 Visual rendering of paragraphs
  • 9.4 Marking document changes: The INS and DEL elements
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档