来源:远方网络 | 2005-6-3 22:15:10 | (有1974人读过)
控制文本的空间
根据Cascading Style Sheet规范,你应当可以控制文本行的高度,字母的空间以及单词的空间。然而非常遗憾,当前版本的Netscape和Microsoft的浏览器只支持行高度的属性。下面的HTML文件说明了这些特性(见图7.25):
<HTML>
<HEAD> <TITLE> Style </TITLE>
<STYLE>
<!--
.BigLines {line-height: 200%}
-->
</STYLE>
</HEAD>
<BODY>
<P CLASS=BigLines>
These lines of text have plenty of space between them.
Can you notice the extra space?
These lines of text have plenty of space between them.
Can you notice the extra space?
These lines of text have plenty of space between them.
Can you notice the extra space?
These lines of text have plenty of space between them.
Can you notice the extra space?
</P>
<P>
These lines of text have no space between them.
Do you notice the missing space?
These lines of text have no space between them.
Do you notice the missing space?
These lines of text have no space between them.
Do you notice the missing space?
These lines of text have no space between them.
Do you notice the missing space?
</P>
</BODY>
</HTML>
当这个文件在网络浏览器上显示时,第一段中的文本行之间的空间大小为200%(当前字体大小的两倍)。除了使用百分号外,你也可以使用前面所述的任何一个度量单位,如象素或点。
图7.25 控制行间距
|