Supported Tags & Attributes

Tk::HyperText supports the following tags and attributes:

Basic HTML Tags

<html>, <head>

It acknowledges that these elements are there, but doesn't do anything with them. But then again, nobody else does anything with them, either.

<title>

If you specify a -titlecommand when configuring your HyperText widget, that callback will be invoked when a <TITLE> tag is found within the HTML code being rendered.

This demonstration program uses such a callback--check out the title on this window.

<body>

The body tag, when found, will recolor the entire HyperText widget with a provided bgcolor and text attribute. Typically, there should only be one <body> in your HTML anyway.

Supported Attributes:
+ bgcolor (background color of the whole page)
+ link (default hyperlink color)
+ vlink (visited link color)
+ alink (active link color)
+ text (default text color)

Text Markup

<font>

Change your font, color, size, or highlight color.

Supported Attributes:
+ face (the font family)
+ size (size, in HTML units, from 0 to 6)
+ color (text color)
+ back (highlight color)

<a>

The <a> tag is only supported as a means of hyperlinking. Support for in-page linking (e.g. <a name>) isn't working yet. If you define a -linkcommand in your HyperText configuration, it will be invoked whenever a hyperlink is clicked on.

Supported Attributes:
+ href (the URL to link to)
+ target (the intended target, e.g. _blank)

<blockquote>

Creates a block of indented text.

<p>, <br>

<p> creates a block-level section of text, or it can be used by itself to insert two newlines in your page. <br> inserts a single newline.

<pre>

Inserts a block-level element of preformatted, Courier New text.

<code>, <tt>

Creates inline "typewriter" text.

<center>, <right>, <left>

Change your text's justification to centered, right, or left.

<h1> - <h6>

Create headings, as seen on this and other pages in the demo.

<sup> - <sub>

Create superscripted and subscripted text, respectively.

<b>, <strong>

Create bold (strong) text.

<i>, <em>

Create italicized (emphasized) text.

<u>, <ins>

Create underlined (inserted) text.

<s>, <del>

Create overstriked (deleted) text.