spacer

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

home / programming / corecss / 1 To page 1To page 2To page 3current pageTo 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-4 layout-grid-type Sample Code

<html>
<head>
<title>layout-grid-type Example</title>
</head>
<style>
div {font-family: PMingLiU; layout-grid-mode: both; layout-flow: vertical-ideographic; font-weight: bold; font-size: 15pt}
</style>
<body>
<code>layout-grid-type: loose</code>
<div style="layout-grid-type: loose">
&#20320;&#21487;&#23559;&#20320;&#35201;&#20834;&#25237;&#30340;&#36008;&#29289;&#21152;&#35387;&#25104;"&#29305;&#23531;&#38917;&#30446;"&#65292;&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#12290;&#25152;&#26377;"&#29305;&#23531;&#38917;&#30446;"&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#22343;&#26371;&#24471;&#21040;&#29305;&#21029;&#34389;&#29702;
&#12290;&#20363;&#22914;&#65306;&#23427;&#20497;&#26371;&#34987;&#25918;&#32622;&#22312;&#20834;&#25237;&#32178;&#38913;&#30340;&#39318;&#38913;&#12289;&#21450;&#22312;&#20854;&#20182;&#32178;&#38913;&#19978;&#29992;&#21152;
&#31895;&#23383;&#39636;&#39023;&#31034;&#12290;&#21152;&#35387;&#36027;&#29992;&#28858;&#27599;&#38917;&#32654;&#20803;&#20116;&#21313;&#20803;&#12290;
</div>
<code>layout-grid-type: strict</code>
<div style="layout-grid-type: strict">
&#20320;&#21487;&#23559;&#20320;&#35201;&#20834;&#25237;&#30340;&#36008;&#29289;&#21152;&#35387;&#25104;"&#29305;&#23531;&#38917;&#30446;"&#65292;&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#12290;&#25152;&#26377;"&#29305;&#23531;&#38917;&#30446;"&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#22343;&#26371;&#24471;&#21040;&#29305;&#21029;&#34389;&#29702;
&#12290;&#20363;&#22914;&#65306;&#23427;&#20497;&#26371;&#34987;&#25918;&#32622;&#22312;&#20834;&#25237;&#32178;&#38913;&#30340;&#39318;&#38913;&#12289;&#21450;&#22312;&#20854;&#20182;&#32178;&#38913;&#19978;&#29992;&#21152;
&#31895;&#23383;&#39636;&#39023;&#31034;&#12290;&#21152;&#35387;&#36027;&#29992;&#28858;&#27599;&#38917;&#32654;&#20803;&#20116;&#21313;&#20803;&#12290;
</div>
</body>
</html>

layout-grid-line and layout-grid-char Properties

The layout-grid-line and layout-grid-char properties share a common purpose: they are there to help the Web author set the dimensions of the grid that the characters will be displayed upon. Too low a value, and the characters will begin to merge together, too high and you end up wasting space. The layout-grid-line is used to set the distance between vertical lines of characters, while layout-grid-char sets the spacing value for the character values contained within the line. The rough equivalent for each property in Western terms would be line-height and letter-spacing respectively, except that we are talking about characters displayed vertically rather than horizontally.

Both properties can take the same types of values, consisting of any one of four properties: none (the default), auto (an optimal value determined by the browser), a measurement value or a percentage value.

The best way to explain these properties is to look at their effects. Listing 11-5 shows two samples of Chinese text -- the first without any layout-grid-line value set and the second set to a relatively wide value. Its results can be seen in Figure 11-6.

Listing 11-5 layout-grid-line Sample Code
<html>
<head>
<title>layout-grid-line Example</title>
</head>
<style>
div {font-family: PMingLiU; layout-grid-mode: both; layout-flow: vertical-ideographic; font-weight: bold; font-size: 15pt}
</style>
<body>
Chinese text with no <code>layout-grid-line</code> value set (<code>font-size</code> set to 15pt)
<div>
&#20320;&#21487;&#23559;&#20320;&#35201;&#20834;&#25237;&#30340;&#36008;&#29289;&#21152;&#35387;&#25104;"&#29305;&#23531;&#38917;&#30446;"&#65292;&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#12290;&#25152;&#26377;"&#29305;&#23531;&#38917;&#30446;"&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#22343;&#26371;&#24471;&#21040;&#29305;&#21029;&#34389;&#29702;
&#12290;&#20363;&#22914;&#65306;&#23427;&#20497;&#26371;&#34987;&#25918;&#32622;&#22312;&#20834;&#25237;&#32178;&#38913;&#30340;&#39318;&#38913;&#12289;&#21450;&#22312;&#20854;&#20182;&#32178;&#38913;&#19978;&#29992;&#21152;
&#31895;&#23383;&#39636;&#39023;&#31034;&#12290;&#21152;&#35387;&#36027;&#29992;&#28858;&#27599;&#38917;&#32654;&#20803;&#20116;&#21313;&#20803;&#12290;
</div>
Same Chinese set to <code>layout-grid-line: 25pt</code>
<div style="layout-grid-line: 25pt">
&#20320;&#21487;&#23559;&#20320;&#35201;&#20834;&#25237;&#30340;&#36008;&#29289;&#21152;&#35387;&#25104;"&#29305;&#23531;&#38917;&#30446;"&#65292;&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#12290;&#25152;&#26377;"&#29305;&#23531;&#38917;&#30446;"&#25110;"&#29305;&#21029;&#35201;&#27714;&#38917;&#30446;"&#22343;&#26371;&#24471;&#21040;&#29305;&#21029;&#34389;&#29702;
&#12290;&#20363;&#22914;&#65306;&#23427;&#20497;&#26371;&#34987;&#25918;&#32622;&#22312;&#20834;&#25237;&#32178;&#38913;&#30340;&#39318;&#38913;&#12289;&#21450;&#22312;&#20854;&#20182;&#32178;&#38913;&#19978;&#29992;&#21152;
&#31895;&#23383;&#39636;&#39023;&#31034;&#12290;&#21152;&#35387;&#36027;&#29992;&#28858;&#27599;&#38917;&#32654;&#20803;&#20116;&#21313;&#20803;&#12290;
</div>
</body>
</html>

Figure 11-6: Internet Explorer showing off the differences in spacing between vertical lines of text when a value is set to layout-grid-line

As you can plainly see from Figure 11-6, layout-grid-line spaces the lines of characters out on the page. Using this property you can more easily control how much content is used to "fill-up" a page, by essentially adding padding between the lines of characters.

Be careful when using the percentage value with layout-grid-line, as it is applied relative to the height of the line. A setting of layout-grid-line: 0% equals the regular default value, whereas a value of layout-grid-line: 100% will space each and every line of characters by their height. Don't use large percentage values unless you want to give your readers some practice using the horizontal scrollbar in order to view all of the text on your page. Also, it should be noted that layout-grid-line does not accept negative values -- if you try, it will set the text to the default layout-grid-line value.

As mentioned earlier, layout-grid-char works in roughly the same way as the letter-spacing property for Western languages, though in this case it sets a spacing value between vertical characters. It gives the Web author greater control over the spacing of characters across the page. As with the previous sample code, Listing 11-6 shows two samples of Chinese text -- the first does not have a layout-grid-char value set and the second is set to a relatively high value. Its results can be seen in Figure 11-7.

home / programming / corecss / 1 To page 1To page 2To page 3current pageTo 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