Type: | Text Blocks |
---|---|
Attributes: | orphans • text-align • text-indent • color • font-family • font-feature-settings • font-stretch • font-style • font-variant • font-weight • font • justification-ratio • letter-spacing • outline-color • outline-width • overprint • requote • suppress-ligatures • text-decoration • text-transform • align • background-color • background-image-dpi • background-image-position • background-image • background-pdf • border-color • border-style • border-width • border • clear • corner-radius • display • float • font-size • height • href • left • line-cap • line-height • line-join • margin • onmouseover • overflow • padding • page-break-after • page-break-inside • position • rotate • size • top • vertical-align • visibility • white-space • width • class • colorspace • direction • id • lang |
See: | a b blockquote body div h1 h2 h3 h4 i img li pre span table td |
The p tag is the basic type of paragraph in the document. All text displayed in the document must be inside a paragraph, either a p or one if it's subtypes (h1 to h4, pre, blockquote) or an "anonymous" p tag, inserted by the XML parser itself.
A paragraph is a rectangle, or block, on the page (in fact it's a special class of DIV. Like other blocks it can have padding, margin and borders specified. As well as inline blocks like span, b, i and so on, since version 1.1, a paragraph can have "block" elements like img and table as children as well.
There are three possible ways to include a block element inside a paragraph.
This is the "normal" use of a paragraph. Text is explicitly surrounded by a P element.
<body> <p>This is the normal use of a paragraph</p> </body>
An anonymous paragraph would be created in this situation, as text is directly inside the BODY element. Internally the XML is translated into the same structure as the previous example.
<body> This is an anonymous paragraph </body>
When embedding blocks, this is how to use the first option listed above.
<body> <p> This text is broken in the middle <img display="inline" src="image.gif"/> by an image </p> </p> </body>
When embedding blocks, this is how to use the second option listed above.
<body> <p> <img display="inline" float="left" src="image.gif"/> This text wraps around an image, which is positioned at the left edge of the paragraph block </p> </p>
When embedding blocks, this is how to use the third option listed above.
<body> <p> This text is displayed above the image <img display="block" src="image.gif"/> and this text is displayed below the image. </p> </p>