HTML4.01規範-文本(2)

Note. We recommend that style sheet implementations provide a mechanism for inserting quotation marks before and after a quotation delimited by BLOCKQUOTE in a manner appropriate to the current language context and the degree of nesting of quotations.html

註釋。咱們建議樣式表的實現能夠提供一種根據當前的語言上下文以及嵌套深度向BLOCKQUOTE框定的引文的頭部和尾部插入引號的機制。
spring

However, as some authors have used BLOCKQUOTE merely as a mechanism to indent text, in order to preserve the intention of the authors, user agents should not insert quotation marks in the default style.express

然而,因爲一些做者已經將BLOCKQUOTE最爲一種縮進文本的機制,爲了避免中斷做者的這種用法,用戶代理缺省狀況下不該該插入引號。
瀏覽器

The usage of BLOCKQUOTE to indent text is deprecated in favor of style sheets.app

用BLOCKQUOTE來縮進文本的用法 是不推薦的,應採用樣式表。ide

9.2.3 Subscripts and superscripts: the SUB and SUP elements

<!ELEMENT (SUB|SUP) - - (%inline;)*    -- subscript, superscript -->

<!ATTLIST (SUB|SUP)
  %attrs;                              -- %coreattrs, %i18n, %events --
  >

Start tag: required, End tag: required字體

開始標籤:必須,結束標籤:必須
ui

Attributes defined elsewherethis

在其餘地方定義的屬性
spa

Many scripts (e.g., French) require superscripts or subscripts for proper rendering. The SUB and SUP elements should be used to markup text in these cases.

不少書寫用字母(好比:法語)須要上標或下標才能正確展現。在這些狀況下,SUB和SUP元素應該用來標記文本。

      H<sub>2</sub>O
      E = mc<sup>2</sup>
      <SPAN lang="fr">M<sup>lle</sup> Dupont</SPAN>

9.3 Lines and Paragraphs

Authors traditionally divide their thoughts and arguments into sequences of paragraphs. The organization of information into paragraphs is not affected by how the paragraphs are presented: paragraphs that are double-justified contain the same thoughts as those that are left-justified.

做者傳統上會將他們的思想和討論分紅段落的序列。信息的段落組織形式不會受到這些段落如何展現的影響:雙向對齊的段落和左對齊的多亂所包含的思想是同樣的。

The HTML markup for defining a paragraph is straightforward: the P element defines a paragraph.

用於定義段落的HTML標記是很直接的:P元素定義一個段落。

The visual presentation of paragraphs is not so simple. A number of issues, both stylistic and technical, must be addressed:

但段落的可視化展示就不是這麼簡單了。下面所列舉的有關樣式及技術的問題必須處理:

  • Treatment of white space
  • Line breaking and word wrapping
  • Justification
  • Hyphenation
  • Written language conventions and text directionality
  • Formatting of paragraphs with respect to surrounding content

  • 空白的處理
  • 折行和單詞折斷
  • 對齊方式
  • 連詞
  • 書寫語言的習慣以及文本方向
  • 環繞內容的段落格式化

We address these questions below. Paragraph alignment and floating objects are discussed later in this document.

下面咱們會逐個討論這些問題。段落對齊方式和浮動對象將在本文檔的後續部分進行討論。

9.3.1 Paragraphs: the P element

<!ELEMENT P - O (%inline;)*            -- paragraph -->

<!ATTLIST P
  %attrs;                              -- %coreattrs, %i18n, %events --
  >

Start tag: required, End tag: optional

The P element represents a paragraph. It cannot contain block-level elements (including P itself).

We discourage authors from using empty P elements. User agents should ignore empty P elements.

P元素展示一個段落。它不能承載塊級別元素(包括P元素自己)。咱們不支持做者使用空的P元素。用戶代理應該忽略空的P元素。

9.3.2 Controlling line breaks

A line break is defined to be a carriage return (&#x000D;), a line feed (&#x000A;), or a carriage return/line feed pair. All line breaks constitute white space.

折行被定義爲一個回車符(&#x000D;),一個換行符(&#x000A;),或者一個回車、換行的組合。全部的折行構成了空白。

For more information about SGML's specification of line breaks, please consult the notes on line breaks in the appendix.

有關SGML規範中折行的更多信息,請參閱附錄中關於折行的註釋。

Forcing a line break: the BR element 

<!ELEMENT BR - O EMPTY                 -- forced line break -->

<!ATTLIST BR
  %coreattrs;                          -- id, class, style, title --
  >

Start tag: required, End tag: forbidden

開始標籤:必須,結束標籤:禁止

Attributes defined elsewhere

在其餘地方定義的屬性

The BR element forcibly breaks (ends) the current line of text.

BR元素強制對當前行文本進行折行(結束)。

For visual user agents, the clear attribute can be used to determine whether markup following the BR element flows around p_w_picpaths and other objects floated to the left or right margin, or whether it starts after the bottom of such objects. Further details are given in the section on alignment and floating objects. Authors are advised to use style sheets to control text flow around floating p_w_picpaths and other objects.

對於可視化用戶代理來講,clear屬性能夠被用來肯定跟隨BR元素的標記是否環繞懸浮於左邊或右邊空白圖像或者其餘對象,或者決定它從這類對象的底部開始。更進一步的細節信息在對齊方式及懸浮對象部分進行描述。做者被建議使用樣式表來控制文本環繞懸浮的圖像和其餘對象。

With respect to bidirectional formatting, the BR element should behave the same way the [ISO10646] LINE SEPARATOR character behaves in the bidirectional algorithm.

考慮到雙向格式化機制,BR元素應該與[ISO10646]中行分隔符字符在雙向機制中的行爲相同。

Prohibiting a line break 

Sometimes authors may want to prevent a line break from occurring between two words. The &nbsp; entity (&#160; or &#xA0;) acts as a space where user agents should not cause a line break.

有時做者可能但願禁止兩個單詞中間進行折行。&nbsp;實體(&#160; or &#xA0;)會造成空格,在空格的地方用戶代理不該該進行折行。

9.3.3 Hyphenation

In HTML, there are two types of hyphens: the plain hyphen and the soft hyphen. The plain hyphen should be interpreted by a user agent as just another character. The soft hyphen tells the user agent where a line break can occur.

在HTML中,有兩種類型的連詞符:通常的連詞符以及軟連詞符。通常的表示符應該被用戶代理當成一個字符來解釋。軟連詞符告知用戶代理在此能夠進行折行。

Those browsers that interpret soft hyphens must observe the following semantics: If a line is broken at a soft hyphen, a hyphen character must be displayed at the end of the first line. If a line is not broken at a soft hyphen, the user agent must not display a hyphen character. For operations such as searching and sorting, the soft hyphen should always be ignored.

解析軟連詞符的瀏覽器必須按照下面的語義進行:若是在軟連詞符位置文本行是折斷的,那麼在第同樣的結尾必須顯示一個連詞字符。若是在軟連詞符位置文本行未折斷,用戶代理必須不顯示連詞字符。對於像搜索以及排序這樣的操做,軟連詞應該被忽略。

In HTML, the plain hyphen is represented by the "-" character (&#45; or &#x2D;). The soft hyphen is represented by the character entity reference &shy; (&#173; or &#xAD;)

在HTML中,通常連詞符用「-」字符(&#45; or &#x2D;)來表示。軟連詞符用字符實體&shy; (&#173; or &#xAD;)表示。

9.3.4 Preformatted text: The PRE element

<!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->

<!ATTLIST PRE
  %attrs;                              -- %coreattrs, %i18n, %events --
  >

Start tag: required, End tag: required

開始標籤:必須,結束標籤:必須

Attribute definitions

屬性定義

width = number [CN]
Deprecated. This attribute provides a hint to visual user agents about the desired width of the formatted block. The user agent can use this information to select an appropriate font size or to indent the content appropriately. The desired width is expressed in number of characters. This attribute is not widely supported currently
不推薦。該屬性爲可視化用戶代理提供了格式化塊的目標寬度信息。用戶代理可使用該信息來選擇合適的字體大小或者對內容進行合適的縮進。目標寬度用字符數量來表示。當前該屬性是沒有被普遍支持的。

 

The PRE element tells visual user agents that the enclosed text is "preformatted". When handling preformatted text, visual user agents:

PRE元素告知可視化用戶代理包含的文本時預格式化的。當處理預格式化文本時,可視化用戶代理:

  • May leave white space intact.
  • May render text with a fixed-pitch font.
  • May disable automatic word wrap.
  • Must not disable bidirectional processing.
  • 應該保持空白空間不變化。
  • 應該使用固定高度的字體顯示文本。
  • 應該禁止自動折詞。
  • 不能機制雙向處理。

Non-visual user agents are not required to respect extra white space in the content of a PRE element.

非可視化用戶代理不須要顧忌在PRE元素內容中額外的空白。

For more information about SGML's specification of line breaks, please consult the notes on line breaks in the appendix.

有關SGML規範中折行的更多信息,請參閱有附錄中關折行的註釋。

The DTD fragment above indicates which elements may not appear within a PRE declaration. This is the same as in HTML 3.2, and is intended to preserve constant line spacing and column alignment for text rendered in a fixed pitch font. Authors are discouraged from altering this behavior through style sheets.

上面的DTD片斷定義了那些元素不能再PRE聲明內部使用。這和HTML3.2中是同樣的,而且應該保留用固定高度字體表示文本的固定行間距以及列對齊方式。做者不要使用樣式表來改變這種缺省的行爲。

The following example shows a preformatted verse from Shelly's poem To a Skylark:

下面的例子展現了一個Shelly's的Skylark詩句:

<PRE>
       Higher still and higher
         From the earth thou springest
       Like a cloud of fire;
         The blue deep thou wingest,
And singing still dost soar, and soaring ever singest.
</PRE>

Here is how this is typically rendered:

下面是該段落的典型的展示:

       Higher still and higher
         From the earth thou springest
       Like a cloud of fire;
         The blue deep thou wingest,
And singing still dost soar, and soaring ever singest.

The horizontal tab character
The horizontal tab character (decimal 9 in [ISO10646] and [ISO88591] ) is usually interpreted by visual user agents as the smallest non-zero number of spaces necessary to line characters up along tab stops that are every 8 characters. We strongly discourage using horizontal tabs in preformatted text since it is common practice, when editing, to set the tab-spacing to other values, leading to misaligned documents.

水平方向的製表符

水平方向製表符(在 [ISO10646][ISO88591] 中爲數字9)一般被可視化代理解析成對於行字符中tab的佔據的最小數量的空格,通常爲8個字符。因爲在編輯時tab空間設置成其餘值是常常發生的,咱們強烈不建議在預格式化文本中使用制水平方向製表符。這樣會致使錯文檔文本對齊方式混亂。

相關文章
相關標籤/搜索