• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Learning DITA

Free DITA training

Free DITA training

  • Log in
  • Register
  • Newsletter
  • Profile
  • Privacy
  • Home
  • About
  • Courses
  • News
  • Resources
  • Support the site
  • Contact
  • Recordings

Separate content from formatting

Posted on 08.30.15

Separate content from formatting
Lesson Progress
0% Complete

One of the major benefits of creating structured content in DITA is the separation of content from formatting. Content that is tagged according to its structure rather than its appearance will be more flexible in its output capabilities.

For example, an unstructured piece of content that has been created with page layout in mind will work best in print or PDF output, and may work poorly or not at all in an HTML-based output. However, a structured DITA topic with no formatting specified in the content should work equally well in multiple output types.

For authors who are accustomed to a formatting-based environment such as a desktop publishing program, it can be tempting to misuse the DITA tags to try to control the look and feel of the content. Using tags for a purpose other than they were intended decreases the value of those tags. Tag abuse can also have unintended consequences—a misused tag may achieve the desired formatting effect in one output type, but destroy the look and feel of the content in another output type.

One form of tag abuse is the forced line break. Do not use the <p> element to control where your lines of text should break, as this will cause problems in responsive output types such as HTML. Use the <codeblock> element to control line breaks for certain parts of your content (for example, code samples).

Contributors
  • Gretyl Kinsey, Scriptorium
Back to

sidebar

Blog Sidebar

  • Scriptorium logo
    Maximize the value of your content. Read more.
  • Scriptorium logo
    Need DITA help? We offer flat-rate consulting. Get help.
  • Scriptorium logo
    Already in DITA and need support? Contact us.
RSSTwitter

Want to add content? Join the ditatraining GitHub repository.

  • Home
  • Sponsor
  • News
  • Contact
  • Privacy

Maintained by Scriptorium Publishing

Logo and site presentation © 2015-2021 Scriptorium Publishing. Content based on the open-source DITA training project.