📄 text.html
字号:
<P>The next example will place a shadow to the right and belowthe element's text. The shadow will have a 5px blur radius and will bered.<PRE>H2 { text-shadow: 3px 3px 5px red }</PRE><P>The next example specifies a list of shadow effects. The firstshadow will be to the right and below the element's text and will bered with no blurring. The second shadow will overlay the first shadoweffect, and it will be yellow, blurred, and placed to the left andbelow the text. The third shadow effect will be placed to the rightand above the text. Since no shadow color is specified for the thirdshadow effect, the value of the element's <a href="colors.html#propdef-color" class="noxref"><spanclass="propinst-color">'color'</span></a>property will be used:</p><PRE>H2 { text-shadow: 3px 3px red, yellow -3px 3px 2px, 3px -3px }</PRE></DIV><div class="example"><P style="display:none">Example(s):</P><P>Consider this example:<PRE>SPAN.glow { background: white; color: white; text-shadow: black 0px 0px 5px;}</PRE><P>Here, the <a href="colors.html#propdef-background" class="noxref"><span class="propinst-background">'background'</span></a> and<a href="colors.html#propdef-color" class="noxref"><span class="propinst-color">'color'</span></a> properties have the samevalue and the <a href="text.html#propdef-text-shadow" class="noxref"><span class="propinst-text-shadow">'text-shadow'</span></a>property is used to create a "solar eclipse" effect:</p><P><IMG SRC="images/eclipse-outline.gif" alt="Solar eclipse effect"><SPAN class="dlink"> <A name="img-eclipse-outline" href="images/longdesc/eclipse-outline-desc.html" title="Long description of text shadow example">[D]</A></SPAN></p></DIV><div class="note"><P><em><strong>Note.</strong>This property is not defined in CSS1. Some shadoweffects (such as the one in the last example) may render textinvisible in UAs that only support CSS1.</em></div><H2>16.4 <a name="spacing-props">Letter and word spacing</a>: the <a href="text.html#propdef-letter-spacing" class="noxref"><spanclass="propinst-letter-spacing">'letter-spacing'</span></a> and <a href="text.html#propdef-word-spacing" class="noxref"><spanclass="propinst-word-spacing">'word-spacing'</span></a> properties</H2><div class="propdef"><dl><dt><span class="index-def" title="'letter-spacing'"><a name="propdef-letter-spacing" class="propdef-title"><strong>'letter-spacing'</strong></a></span><dd><table class="propinfo" cellspacing=0 cellpadding=0><tr valign=baseline><td><em>Value:</em> <td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a><tr valign=baseline><td><em>Initial:</em> <td>normal<tr valign=baseline><td><em>Applies to:</em> <td>all elements<tr valign=baseline><td><em>Inherited:</em> <td>yes<tr valign=baseline><td><em>Percentages:</em> <td>N/A<tr valign=baseline><td><em>Media:</em> <td><a href="media.html#visual-media-group" class="noxref">visual</a></table></dl></div><P>This property specifies spacing behavior betweentext characters. Values have the following meanings:</P><dl><dt><strong>normal</strong><dd>The spacing is the normal spacing for the current font.This value allows the user agent to alter the spacebetween characters in order to justify text.<dt><span class="index-inst" title="<length>"><a name="x10" href="syndata.html#value-def-length" class="noxref"><spanclass="value-inst-length"><strong><length></strong></span></a></span><dd>This value indicates inter-character space <em>inaddition to</em> the default space betweencharacters. Values may be negative, but there may beimplementation-specific limits. User agents may not further increase or decrease the inter-characterspace in order to justify text.</dl><P>Character spacing algorithms are user agent-dependent. Characterspacing may also be influenced by justification (see the <a href="text.html#propdef-text-align" class="noxref"><spanclass="propinst-text-align">'text-align'</span></a> property).<div class="example"><P style="display:none">Example(s):</P><P>In this example, the space between characters inBLOCKQUOTE elements is increased by '0.1em'.<PRE>BLOCKQUOTE { letter-spacing: 0.1em }</PRE><P>In the following example, the user agent is not permittedto alter inter-character space:</p><PRE>BLOCKQUOTE { letter-spacing: 0cm } /* Same as '0' */</PRE></div><P> When the resultant space between two characters is not the same asthe default space, user agents should not use <a name="x11"><span class="index-inst" title="ligatures">ligatures.</span></a><P><span class="index-inst" title="conformance"><a name="x12"href="conform.html#conformance">Conforming user agents</a></span>may consider the value of the <a href="text.html#propdef-letter-spacing" class="noxref"><spanclass="propinst-letter-spacing">'letter-spacing'</span></a> property to be'normal'.<div class="propdef"><dl><dt><span class="index-def" title="'word-spacing'"><a name="propdef-word-spacing" class="propdef-title"><strong>'word-spacing'</strong></a></span><dd><table class="propinfo" cellspacing=0 cellpadding=0><tr valign=baseline><td><em>Value:</em> <td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a><tr valign=baseline><td><em>Initial:</em> <td>normal<tr valign=baseline><td><em>Applies to:</em> <td>all elements<tr valign=baseline><td><em>Inherited:</em> <td>yes<tr valign=baseline><td><em>Percentages:</em> <td>N/A<tr valign=baseline><td><em>Media:</em> <td><a href="media.html#visual-media-group" class="noxref">visual</a></table></dl></div><P>This property specifies spacing behavior between words.Values have the following meanings:</p><dl><dt><strong>normal</strong><dd>The normal inter-word space, as defined by the current font and/orthe UA.<dt><span class="index-inst" title="<length>"><a name="x14" href="syndata.html#value-def-length" class="noxref"><spanclass="value-inst-length"><strong><length></strong></span></a></span><dd>This value indicates inter-word space <em>inaddition to</em> the default space betweenwords. Values may be negative, but there may beimplementation-specific limits. </dl><P>Word spacing algorithms are user agent-dependent. Word spacing isalso influenced by justification (see the <a href="text.html#propdef-text-align" class="noxref"><spanclass="propinst-text-align">'text-align'</span></a> property).<div class="example"><P style="display:none">Example(s):</P><P>In this example, the word-spacing between each word in H1 elements isincreased by '1em'.<PRE>H1 { word-spacing: 1em }</PRE></div><P><span class="index-inst" title="conformance"><a name="x15"href="conform.html#conformance">Conforming user agents</a></span> mayconsider the value of the <a href="text.html#propdef-word-spacing" class="noxref"><spanclass="propinst-word-spacing">'word-spacing'</span></a> property to be'normal'.<H2>16.5 <a name="caps-prop">Capitalization</a>: the <a href="text.html#propdef-text-transform" class="noxref"><spanclass="propinst-text-transform">'text-transform'</span></a> property</H2><div class="propdef"><dl><dt><span class="index-def" title="'text-transform'"><a name="propdef-text-transform" class="propdef-title"><strong>'text-transform'</strong></a></span><dd><table class="propinfo" cellspacing=0 cellpadding=0><tr valign=baseline><td><em>Value:</em> <td>capitalize | uppercase | lowercase | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a><tr valign=baseline><td><em>Initial:</em> <td>none<tr valign=baseline><td><em>Applies to:</em> <td>all elements<tr valign=baseline><td><em>Inherited:</em> <td>yes<tr valign=baseline><td><em>Percentages:</em> <td>N/A<tr valign=baseline><td><em>Media:</em> <td><a href="media.html#visual-media-group" class="noxref">visual</a></table></dl></div><P>This property controls capitalization effects ofan element's text. Values have the following meanings:</p><DL> <DT><strong>capitalize</strong> <DD>Puts the first character of each word in uppercase. <DT><strong>uppercase</strong> <DD>Puts all characters of each word in uppercase. <DT><strong>lowercase</strong> <DD>Puts all characters of each word in lowercase. <DT><strong>none</strong> <DD>No capitalization effects.</DL><P> The actual transformation in each case is written languagedependent. See RFC 2070 (<a href="refs.html#ref-RFC2070" rel="biblioentry" class="noxref"><span class="normref">[RFC2070]</span></a>) for ways to find the language ofan element.<P><span class="index-inst" title="conformance"><a name="x17"href="conform.html#conformance">Conforming user agents</a></span>may consider the value of <a href="text.html#propdef-text-transform" class="noxref"><spanclass="propinst-text-transform">'text-transform'</span></a> to be 'none'for characters that are not from the Latin-1 repertoire and forelements in languages for which the transformation is different fromthat specified by the case-conversion tables of ISO 10646(<a href="refs.html#ref-ISO10646" rel="biblioentry" class="noxref"><span class="normref">[ISO10646]</span></a>).<div class="example"><P style="display:none">Example(s):</P><P>In this example, all text in an H1 element is transformed to uppercasetext.<PRE>H1 { text-transform: uppercase }</PRE></div><H2>16.6 <a name="white-space-prop">Whitespace</a>: the <a href="text.html#propdef-white-space" class="noxref"><spanclass="propinst-white-space">'white-space'</span></a> property</H2><div class="propdef"><dl><dt><span class="index-def" title="'white-space'"><a name="propdef-white-space" class="propdef-title"><strong>'white-space'</strong></a></span><dd><table class="propinfo" cellspacing=0 cellpadding=0><tr valign=baseline><td><em>Value:</em> <td>normal | pre | nowrap | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a><tr valign=baseline><td><em>Initial:</em> <td>normal<tr valign=baseline><td><em>Applies to:</em> <td>block-level elements<tr valign=baseline><td><em>Inherited:</em> <td>yes<tr valign=baseline><td><em>Percentages:</em> <td>N/A<tr valign=baseline><td><em>Media:</em> <td><a href="media.html#visual-media-group" class="noxref">visual</a></table></dl></div><P> This property declares how <ahref="syndata.html#whitespace">whitespace</a> inside the element ishandled. Values have the following meanings:</P><dl><dt><strong>normal</strong><dd>This value directs user agents to collapse sequencesof whitespace, and break lines as necessary to fill line boxes.Additional line breaks may be created by occurrences of "\A" ingenerated content (e.g., for the BR element in HTML).<dt><strong>pre</strong><dd>This value prevents user agents from collapsing sequencesof whitespace. Lines are only broken at newlines in the source, orat occurrences of "\A" in generated content.<dt><strong>nowrap</strong><dd>This value collapses whitespace as for 'normal', but suppressesline breaks within text except for those created by "\A" in generatedcontent (e.g., for the BR element in HTML).</dl><div class="example"><P style="display:none">Example(s):</P><P> The following examples show what <ahref="syndata.html#whitespace">whitespace</a> behavior is expectedfrom the PRE and P elements, and the "nowrap" attribute in HTML.<PRE>PRE { white-space: pre }P { white-space: normal }TD[nowrap] { white-space: nowrap }</PRE></div><P><span class="index-inst" title="conformance"><a name="x19"href="conform.html#conformance">Conforming user agents</a></span> may <span class="index-inst" title="ignore"><a name="x20"href="syndata.html#ignore">ignore</a></span> the <a href="text.html#propdef-white-space" class="noxref"><spanclass="propinst-white-space">'white-space'</span></a> property in authorand user style sheets but must specify a value for it in the defaultstyle sheet.<hr class="navbar"><div class="navbar" align="center"><p><a href="fonts.html">previous</a> <a href="tables.html">next</a> <a href="cover.html#minitoc">contents</a> <a href="propidx.html">properties</a> <a href="indexlist.html">index</a> </div></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -