天天看點

html的文字樣式、下行線、删除線、上标、下标等實作方式

先看效果如下:

html的文字樣式、下行線、删除線、上标、下标等實作方式
代碼如下:

<del>del标簽删除線</del><br/>
            <strike>strike标簽删除線</strike><br/>
            <s>s标簽删除線</s> <br/>
            <u>u标簽下劃線</u><br/>
            <p style="text-decoration: underline;">樣式設定下行線</p></FONT><br/>
            <b>加粗文字</b> <br/>
            <i>斜文字</i> <br/><br/>
            <tt>等寬字型</tt> <br/>
            上标<sup>2</sup> <br/>
            下标<sub>20</sub> <br/>      

用簡單的“hr”語句就能實作多樣化的分割效果: 

最基本的:<hr width=300 size=1 color=#5151A2 align=center noshade>。其中 width 規定線條的長度,還可以是百分比;color 表示顔色,size 表示厚度;align 規定線條位置,有left、right、center;noshade 表示是否有立體效果。

  兩頭漸變透明:

<hr width=80% size=3 color=#5151A2 style="FILTER: alpha(opacity=100,finishopacity=0,style=3)">

--------------------------------------------------------------------------------

  右邊漸變透明:

<hr width=80% size=3 color=#5151A2 style="FILTER: alpha(opacity=100,finishopacity=0,style=1)">

  畫虛線:

<hr width=80% size=1 color=#5151A2 style="border:1 dashed #5151A2">

  畫雙線:

<hr width=80% size=3 color=#5151A2 style="border:3 double green">

  立體效果:

<hr width=80% size=3 color=#5151A2 style="filter:progid:DXImageTransform.Microsoft.Shadow(color#5151A2,direction:145,strength:15)">

  紡棰形:

<hr width=80% size=30 color=#5151A2 style="filter:alpha(opacity=100,finishopacity=0,style=2)">

  鋼針效果:

<hr width=80% size=3 color=#5151A2 style="filter:progid:DXImageTransform.Microsoft.Glow(color=#5151A2,strength=10)">

<hr>标簽的作用是産生一線水準線

<hr>标簽的屬性包括

屬性 描述 DTD
align
  • center
  • left
  • right
規定水準線的排列。 TF
noshade

當設定為 true 時,水準線呈現為純色(2D 效果)。

當設定為 false 時,水準線顯示為雙色凹槽(3D 效果)。

size
  • pixels
  • %
規定水準線的厚度(高度)。
width
規定了水準線的寬度。

看下面的例子

<hr align="center">

<hr align="left">

<hr align="right">

<hr noshade="true">

<hr noshade="false">

<hr size="5">

<hr width="500px">

<hr align="left" noshade="false" size="4" width="500px" color="#ff0000">

顯示結果分别為:

沒有設定寬度的水準線預設為100%,是以前三條設定的對齊看不到效果

1、普通分隔線:<hr>

2、分隔線寬度屬性:<hr width=50%> 或者 <hr width=250> (寬度為實際點數或百分比)

3、分隔線位置屬性:<hr align=right width=50%> (位置分為 Left、Center、Right 三種)

4、分隔線厚度屬性:<hr style="height:10px"> (奇怪,height=10 似乎不能起到效果)

5、分隔線無陰影屬性:<hr style="height:10px" noshade>

6、分隔線彩色屬性:<hr color=red> 或者 <hr color=#FF0000> (顔色可調)

7、漸變顔色的分隔線: 

<hr style="filter:alpha(opacity=5,finishopacity=100,style=1);height:10px" color=green>

<hr style="filter:alpha(opacity=100,finishopacity=5,style=1);height:10px" color=blue>

8、中心透明的分隔線: 

<hr style="filter:alpha(opacity=0,finishopacity=100,style=2);height:12px" color=orange>

<hr style="filter:alpha(opacity=0,finishopacity=100,style=3);height:12px" color=#FF00FF>

9、中心不透明的分隔線: 

<hr style="filter:alpha(opacity=100,finishopacity=0,style=2);height:15px" color=yellow>

<hr style="filter:alpha(opacity=100,finishopacity=0,style=3);height:15px" color=#00FFFF>

10、波浪線: 

<hr style="filter:wave(strength=9,freq=2,lightstrength=20,phase=9);height:15px" color=pink width=95%>

11、三色線: 

<hr style="border-top: #ff0000 solid; color: #00ff00; border-bottom: #0000ff solid; height: 9px">

12、虛線: 

<hr style="border-top: 2px dashed; border-bottom: 2px dashed; height: 2px" color=black>

13、豎線: 

<hr style="height:100px; width:4px" color=orange>

<hr style="filter:alpha(opacity=100,finishopacity=5,style=2); height:100px; width:5px" color=navy>

<hr style="filter:alpha(opacity=0,finishopacity=100,style=2);height:100px; width:4px" color=red>