<div>

The <div> element is used to organize subsets of content into logical groups that are not intended to be or should not be contained as a topic.

The <div> element is designed to be a grouping element; it does not imply any explicit semantics or contain an explicit title. This avoids enabling the creation of deeply-nested content that would otherwise be written as separate topics. If the content requires a title, use a <section> element, a nested <topic>, or possibly a <fig> element.

Content models

See appendix for information about this element in OASIS document type shells.

Inheritance

- topic/div

Example

This section is non-normative.

Example 1. Using <div> for grouping

In the following example, a <div> element is used to organize several elements together so that they can be referenced by @conref or @conkeyref:

...
<div id="div-01">
 <p>The first paragraph</p>
 <p>The second paragraph</p>
 <note>This is a note</note>
</div>
...

Without using a <div> element, the content could not be grouped for content referencing since the start and end elements are of different types.

Example 2. Using <div> for specialization

In the following example, <div> is used as the basis for specializing a new domain element, <pullquote>:

<!ENTITY % pullquote.content
  "(%div.cnt;)*"
>
<!ENTITY % pullquote.attributes
             "%univ-atts;
              outputclass 
                        CDATA 
                                  #IMPLIED"
>
<!ELEMENT pullquote    %pullquote.content;>
<!ATTLIST pullquote    %pullquote.attributes;>

<!ATTLIST pullquote      %global-atts;  class CDATA "+ topic/div pubcontent-d/pullquote ">

Instances of <pullquote> could then be used in both <body> and <section> contexts:

<topic id="article-01">
  <title>My Article</title>
  <body>
    <p>Something pithy someone said</p>
    <pullquote><p>Something Pithy</p></pullquote>
    <!-- ... -->
    <section spectitle="Deep Dive">
      <p>This is really really pithy</p>
      <pullquote><p>Really Pithy</p></pullquote>
      <!-- ... -->
    </section>
  </body>
</topic>

Content model

(Text | <dl> | <div> | <fig> | <image> | <lines> | <lq> | <note> | <object> | <ol> | <p> | <pre> | <simpletable> | <sl> | <table> | <ul> | <boolean> | <cite> | <keyword> | <ph> | <q> | <term> | <text> | <tm> | <xref> | <state> | <data> | <data-about> | <foreign> | <unknown> | <draft-comment> | <fn> | <indextermref> | <indexterm> | <required-cleanup>)*

Contained by

<abstract>, <body>, <bodydiv>, <dd>, <desc>, <div>, <draft-comment>, <entry>, <example>, <fig>, <figgroup>, <fn>, <itemgroup>, <li>, <linkinfo>, <lq>, <note>, <p>, <section>, <sectiondiv>, <stentry>

Zero or more of the following
  • Text
  • <boolean>
  • <cite>
  • <data>
  • <data-about>
  • <div>
  • <dl>
  • <draft-comment>
  • <fig>
  • <fn>
  • <foreign>
  • <image>
  • <indexterm>
  • <indextermref>
  • <keyword>
  • <lines>
  • <lq>
  • <note>
  • <object>
  • <ol>
  • <p>
  • <ph>
  • <pre>
  • <q>
  • <required-cleanup>
  • <simpletable>
  • <sl>
  • <state>
  • <table>
  • <term>
  • <text>
  • <tm>
  • <ul>
  • <unknown>
  • <xref>

Contained by

  • <abstract>
  • <body>
  • <bodydiv>
  • <dd>
  • <desc>
  • <div>
  • <draft-comment>
  • <entry>
  • <example>
  • <fig>
  • <figgroup>
  • <fn>
  • <itemgroup>
  • <li>
  • <linkinfo>
  • <lq>
  • <note>
  • <p>
  • <section>
  • <sectiondiv>
  • <stentry>

Inheritance

- topic/div

The <div> element is a base element type. It is defined in the topic module.

Attributes

The following attributes are available on this element: Universal attribute group and outputclass.