Office saves paragraphs using the P element. Whenever possible, Office uses standard HTML attributes to save paragraph settings to HTML. Office also uses CSS to store and display paragraph settings.
The general syntax for Office paragraph elements follows, where stylename is the name of the style applied to the paragraph, center|right are the alignment values, and attributes are the style attributes for the paragraph.
<p class=stylename align=center|right style='attributes'>
For more information about how styles are saved to HTML, see the CSS Styles topic.
Word has more paragraph settings than other Office programs and uses the following style attributes to store these settings.
| Word paragraph setting | Style attribute |
| Don't hyphenate | mso-hyphenate |
|
Line spacing rule |
mso-line-height-rule, mso-line-height-alt |
| Outline level | mso-outline-level |
| Page break before | page-break-before |
| Widow/Orphan control Keep lines together Keep with next Suppress line numbers |
mso-pagination |
For information about how Word saves paragraph spacing settings to HTML, see the Paragraph Spacing topic.
Empty paragraphs are often used for spacing, and Office saves
empty paragraphs to HTML so that they are visible in a Web browser. To do so, a nonbreaking space is inserted in the P element between
<![if !supportEmptyParas]>
and <![endif]> tags in case the browser does not support empty
paragraphs. Office also inserts an o:p element within the P
element.
For more information about the style attributes that Office uses and their possible values, see the Style Attributes topic.