BYU Home page BRIGHAM YOUNG UNIVERSITY  
Search BYU 
Styled Text

Styled Text
Learn how to create styled text, bold, italic, underlined and more, on your ECEn XML web pages.

Bold, italic, underlined and otherwise styled text looks different than most of the text on a web page, so we might say that such text is special text. In the ECEn XML templates, we use the <special-text> tag for styled text and other kinds of special text on web pages.

These instructions assume that you already have an ECEn XML web page to edit and know at least a bit about XML. Most content, such as text, links, lists, pictures etc., belongs in the <content> portion of your page; check the instructions below to see if you need to make sure that you have a page with a <content> portion. If you need a quick tutorial or just a simple starter web page download, check out the 'Howdy, World' Tutorial where you can get a brief overview of what files you need to set up a basic ECEn XML web page.

There are two main ways to style text on an ECEn XML web page:
Create special text with certain basic styles.
This way works best for styling book titles, warnings, etc.
Create titles of sections.
This way works best for creating headings for paragraph, tables, and other content.

Basic styles: bold, italic and underlined
Here is some "code" to make a book title italic:

<special-text>
<style>italic</style>
<text>Goodnight Moon</text>
</special-text>

Here is what the italic text would look like on an ECEn XML web page:

Goodnight Moon

To create styled text:
1
Create an opening and closing <special-text> tag.
2
Place a <style> tag between the <special-text> tags. Inside the <style> tag specify how you'd like the styled text to appear, i.e., bold, italic, underlined. For other possible styles, have a glance at the ECEn XML Templates Reference.
3
Place a <text> tag after the <style> tags. Inside the <text> tag specify what the styled text should say.

Heading styles
Managing styles for headings using ECEn XML is easy. Just title your sections as you create your content and your titles will be styled as headings.

For example, take a look at this simple block of text content "code":

<section>
<title><text>Pizza</text></title>
<text>Yum, pizza!</text>
</section>

Here is how that simple block of content would look in an ECEn XML web page:

Pizza
Yum, pizza!

You can see that the title of the section,'Pizza', is styled as heading, but that the code did not specify that the word 'Pizza' be all uppercase, underlined and a specific size. The ECEn XML templates choose the styles for the title of your section based on where the section is in the XML document.

We don't need to get into the details of how the ECEn XML templates choose the style for your section titles. All you need to do is organize your content in sections and sub-sections, and the templates will make the headings look right.

If you need an example, have a look at the Titles and Headings Example page. You can view the XML source in your browser by clicking the 'this XML' link at the bottom of the page. Or you can download the XML source from the Common Tasks Downloads on the righti side of this page. (Right click, Save Link Target As...)

Common Task Downloads


Maintained by The ECEn Web Team. Based on v. 3.8 of the ECEn web templates (view XML, live XML, see other formats).
Copyright © 1994-2005. Brigham Young University. All Rights Reserved.