DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> CSS入門知識 >> CSS特效代碼
<hr/> 標籤的屬性與樣式技巧大全
編輯:CSS特效代碼     

用簡單的 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> 標籤的作用是產生一條水平線,其屬性包括:

  • align(center/left/right):規定水平線的排列。
  • noshade:設為 true 時呈純色(2D 效果),設為 false 時呈雙色凹槽(3D 效果)。
  • size(pixels/%):規定水平線的厚度(高度)。
  • width(pixels/%):規定水平線的寬度。

範例:

<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%,所以前幾條 align 設定看不出效果。

更多變化:

1、普通分隔線:<hr>

2、寬度屬性:<hr width=50%> 或 <hr width=250>

3、位置屬性:<hr align=right width=50%>

4、厚度屬性:<hr style="height:10px">

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>

(本文轉自「何問起」)

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved