HTML Cookbook Basic HTML Course

It's Easy!


Alternate Version

Text Direction

Amaze your friends, confuse your enemies, write secret messages! Someday, that is :-(

The CSS direction property allows you to declare which direction your text goes. Direction is mostly for fun even though it has serious applications if you work with other languages.


Text direction declaration

The form for a direction declaration is:
direction: value

value may be ltr (left to right) or rtl (right to left). ltr is the default.


Browser Support

WebTV has no support for this W3C CSS 2 specification at this time. None, nada, nil, zilch, a big goose egg, zero.

MSIE 6.0, Netscape 7.2 and Firefox (Mozilla) move the sentence to the right side of the page and move the period to the front of a sentence. See the screenshots below.

So basically, direction has no support at this time, but I didn't know that until I used it.


Sample stylesheet

/* right-to-left text */
.backwards { direction: rtl }

Example Code

<p class="backwards">
This sentence should appear backwards.
</p>

Should Appear as:

.sdrawkcab raeppa dluohs ecnetnes shiT

But actually appears as:

This sentence should appear backwards.

PC Screenshot (white page)
PC Screenshot (black page)


Assignment

Call or write to WebTV and demand that they support direction in the next upgrade. Or not.

Happy coding!
Gnubee

Links
Tips
Tools
References
Rules
HTML Help Gnubee - Newsgroup
HTML Course Contents (Home)

Valid XHTML 1.0!

Valid CSS!