Block and inline elements
A block element always begins on a new line when displayed. It exists in its own virtual box and is always followed by a carriage return (like if someone hit the "Enter" key after typing in some text). There are 12 types of block elements:
- Headings
- Numbered lists
- Bullet lists
- List items
- Embedded objects
- Literal text
- Tables
- Table rows
- Table header cells
- Table cells
- Paragraphs
- Block custom tags
An inline element becomes the part of other text in a natural way. There is no box around inline elements and it doesn't look like if someone hit the "Enter" key after typing it in. There are 6 types of inline elements:
- Bold text
- Italic text
- Hyperlinks
- Anchors
- Lines
- Inline custom tags
Block elements are represented by block-level tags in the resulting XHTML code, inline elements are represented by inline tags. Because of this there are two main rules for block and inline elements.
XHTML | eZ Publish XML (Online Editor) |
---|---|
Placing text or other inline tags directly within the "body" tag is not allowed. They should be surrounded by a block level tag. |
Text and/or inline elements are always encapsulated by a paragraph (you can see the tag "p" in the OE status bar, but note that the paragraph tags are not shown in the simplified XML). Please note that text or inline elements inside table cells are encapsulated by paragraphs both in eZ Publish XML and resulting XHTML. Text or inline elements inside block custom tags are also encapsulated by paragraphs. |
Block-level tags may contain inline tags inside but not the other way around. For example, a paragraph tag can not be placed inside a bold tag. |
Block elements may contain inline elements but not the other way around. For example, if you select two paragraphs and click the "Bold" button, the OE will create two bold elements (one inside each paragraph). |
Please note that a single "p" tag inside a table cell will be omitted in the resulting XHTML code if you add the following line into the "[ezxhtml]" section of an override for the "settings/ezxml.ini" configuration file:
RenderParagraphInTableCells=disabled
Svitlana Shatokhina (15/12/2005 8:29 am)
Svitlana Shatokhina (15/02/2006 1:15 pm)
Comments