CSS設置文本——字母、單詞、段落
<1>字母大小寫
1 <html>
2 <head>
3 <style type="text/css">
4 h1 {text-transform: uppercase}
5 p.uppercase {text-transform: uppercase}
6 p.lowercase {text-transform: lowercase}
7 p.capitalize {text-transform: capitalize}
8 </style>
9 </head>
10
11 <body>
12 <h1>This Is An H1 Element</h1>
13 <p class="uppercase">This is some text .</p>
14 <p class="lowercase">This is some text .</p>
15 <p class="capitalize">This is some text .</p>
16 </body>
17 </html>
capitalize這個詞的意思就是“把……的首字母大寫”。
當你看了這個效果之后就一切都明白了。
<2>單詞間距
1 <html>
2 <head>
3 <style type="text/css">
4 p.spread {word-spacing: 30px}
5 p.tight {word-spacing: -0.5em}
6 </style>
7 </head>
8
9 <body>
10 <p class="spread">This is some text.</p>
11 <p class="tight">This is some text.</p>
12 </body>
13 </html>
這個用法可以將外觀設置的更加好看。
更加美觀。
<3>段落不換行
1 <html>
2 <head>
3 <style type="text/css">
4 p {white-space: nowrap}
5 </style>
6 </head>
7
8 <body>
9 <p>
10 這是一些文本。
11 這是一些文本。
12 這是一些文本。
13 這是一些文本。
14 這是一些文本。
15 這是一些文本。
16 這是一些文本。
17 這是一些文本。
18 這是一些文本。
19 這是一些文本。
20 這是一些文本。
21 這是一些文本。
22 </p>
23 </body>
24 </html>
就目前來看,這個技術好像沒有什么用處。
posted on 2011-09-17 22:36 More study needed. 閱讀(347) 評論(0) 收藏 舉報
浙公網安備 33010602011771號