spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / corecss / 1 To page 1current pageTo page 3To page 4To page 5To page 6To page 7
[previous][next]

Core CSS: Chapter 11: Text Properties: Extensions

Senior Lotus Notes Developer
AMS Staffing Solutions
US-MD-Baltimore

Justtechjobs.com Post A Job | Post A Resume
Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management

Listing 11-2 layout-flow Example #2

<html>
<head>
<title>layout-flow Example 2</title>
</head>
<style>
span.chinese {font-family: ËÎÌå,MingLiU; font-weight: bold; font-size: 35pt}
span.english {font-family: arial; font-weight: bold; font-size: 35pt}
span.english-horizontal {font-family: arial; font-weight: bold; font-size: 35pt; layout-flow: horizontal}
</style>
<body>

<div style="layout-flow: vertical-ideographic">
<span class="chinese" lang="zh-tw">
&#27489;&#36814;&#28459;&#28216;</span>
<span class="english">PanelX –</span>
<span class="chinese">
&#24179;&#38754;&#39023;&#31034;&#23631;&#26989;&#30028;&#30340;</span>
<span class="english">Portal </span>
<span class="chinese">&#21450;</span>
<span class="english">Exchange</span>
</div>

<hr />

<div style="layout-flow: vertical-ideographic">
<span class="chinese" lang="zh-tw">
&#27489;&#36814;&#28459;&#28216;</span>
<span class="english-horizontal">PanelX –</span>
<span class="chinese">
&#24179;&#38754;&#39023;&#31034;&#23631;&#26989;&#30028;&#30340;</span>
<span class="english-horizontal">Portal </span>
<span class="chinese">&#21450;</span>
<span class="english-horizontal">Exchange</span>
</div>

</body>
</html>


Figure 11-2: Combined Chinese and English text displayed first in vertical format, and then in a combined vertical and horizontal formats

As you can see from Figure 11-2, the English text is rendered in horizontal format, but is still contained within the vertical format of the Chinese characters on the page. This does not simply rotate the English characters 90 degrees counterclockwise as you might expect, but renders the whole English word horizontal. Depending on your needs, you may find that the text layout is "too wide" when rendered in this manner, but it is worth knowing that it is available.

The layout-flow property sets the height of each vertical column automatically, dependant on the amount of content to be displayed. This can be overridden using the height property set to a specific value. All text that exceeds the selected value overflows into the following left column of characters.

Even though this is an addition first introduced in Internet Explorer 5.5, by version 6.0 of the browser this property has been deprecated by Microsoft in favor of the writing-mode property.

WRITING-MODE PROPERTY

The writing-mode property was first introduced in a beta version of Internet Explorer 5.5, and has since become the favored way for handling the flow of non-Western character sets on a Web page. This is due to the fact that an expanded version of the writing-mode property has been incorporated into the CSS3 specification, and clearly sets the way in which text layout for different language sets is going to be accomplished in future standards-compatible browsers.

Like the layout-flow property, at the moment writing-mode has two working values which equate roughly with the text layout styles for Western and Asian languages. The default value is lr-tb, which stands for "left-to-right, top-to-bottom", and equates with Western styles of text layout. The other value is tb-rl, which stands for "top-to-bottom, right-to-left", which is the setting to be used for Asian languages. At first, this wouldn't seem to be radically different from the layout-flow property, and in fact, it isn't -- the two properties are functionally equivalent. Like layout-flow, writing-mode does not rotate English or other Western letters back to their proper orientation automatically, a point which is illustrated in Figure 11-3, which compares equivalent code for layout-flow against writing-mode, as depicted in Listing 11-3.

Listing 11-3 layout-flow versus writing-mode

<html>
<head>
<title>writing-mode Example</title>
</head>
<style>
span.chinese {font-family: ËÎÌå,MingLiU; font-weight: bold; font-size: 34pt}
span.english-horizontal-lf {font-family: arial; font-weight: bold; font-size: 34pt; layout-flow: horizontal}
span.english-horizontal-wm {font-family: arial; font-weight: bold; font-size: 34pt; writing-mode: lr-tb}
</style>
<body>

<strong>Using <code>layout-flow</code></strong>
<div style="layout-flow: vertical-ideographic">
<span class="chinese">
&#27489;&#36814;&#28459;&#28216;</span>
<span class="english-horizontal-lf">PanelX &#150;</span>
<span class="chinese">
&#24179;&#38754;&#39023;&#31034;&#23631;&#26989;&#30028;&#30340;</span>
<span class="english-horizontal-lf">Portal </span>
<span class="chinese">&#21450;</span>
<span class="english-horizontal-lf">Exchange</span>
</div>

<hr />
<strong>Using <code>writing-mode</code></strong>
<div style="writing-mode: tb-rl">
<span class="chinese">
&#27489;&#36814;&#28459;&#28216;</span>
<span class="english-horizontal-wm">PanelX &#150;</span>
<span class="chinese">
&#24179;&#38754;&#39023;&#31034;&#23631;&#26989;&#30028;&#30340;</span>
<span class="english-horizontal-wm">Portal </span>
<span class="chinese">&#21450;</span>
<span class="english-horizontal-wm">Exchange</span>
</div>

</body>
</html>

Figure 11-3: The effects of layout-flow versus writing-mode; they are functionally equivalent

home / programming / corecss / 1 To page 1current pageTo page 3To page 4To page 5To page 6To page 7
[previous][next]

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags

Created: March 27, 2003
Revised: August 19, 2003

URL: http://webreference.com/programming/corecss/1