已掉线,重新登录

首页 > 绿虎论坛 > 历史版块 > 编程 > 其他编程语言 > 源码

标题: 分享css分割线

作者: @Ta

时间: 2013-01-25

点击: 3063


实心的线条:<HR align=left width=490 color=#990099 SIZE=3 noShade>
竖直线:<HR align=center width=1 color=red size=100>

虚线:<hr size=1 style="color: blue;border-style:dotted;width:490">


双线:<hr size=1 style="COLOR:#ff9999;border-style:double;width:490">


立体感:<hr size=8 style="COLOR: #ffd306;border-style:outset;width:490;">


左边逐渐变透明:<hr size="2"color="#ff9966"style="filter:alpha(opacity=10,finishopacity=100,style=1,startX=0,startY=0,finishX=100,finishY=100);width:490;">

右边逐渐变透明:<hr size="2"color="#ff9966"style="filter:alpha(opacity=10,finishopacity=100,style=1,startX=100,startY=100,finishX=0,finishY=0);width:490;">

样式:

代码如下:

<hr STYLE="WIDTH: 100%; COLOR: #999; BORDER-TOP-STYLE: dashed; BORDER-RIGHT-STYLE: dashed; BORDER-LEFT-STYLE: dashed; HEIGHT: 1px; BORDER-BOTTOM-STYLE: dashed"></HR>


用<hr>标签
最基本的:<hr width=300 size=1 color=#5151A2 align=center noshade>
其中 width 规定线条的长度,还可以是百分比;color 表示颜色,size 表示厚度;
align 规定线条位置,有left(左对齐)、right(右对齐)、center(中对齐);noshade 表示是否有立体效果。

两头渐变透明: (利用CSS滤镜处理)
<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)">
也可以利用<table>标签
如<table width="100%"><tr><td height="1"bgcolor="#FF0000"></td></tr></table>或者利用CSS里的background属性,更方便控制划线效果,比如像一个一像素的点(dot.gif)
水平划线:<td style="background:url(dot.gif) repeat-x center">&nbsp;</td>
垂直划线:<td style="background:url(dot.gif) repeat-y center">&nbsp;</td>
当然还有其他很多方法,大家可以参考HTML及CSS相关资料



预览文件:(文件1)css.html

[隐藏样式|查看源码]


『回复列表(3|隐藏机器人聊天)』

1. 收了!很好
(/@Ta/2013-01-25 16:47//)

2. @残缘 麻烦弄到文本中。嘎嘎…
(/@Ta/2013-01-25 16:56//)

3. @Mirror    最后有个html
(/@Ta/2013-01-25 21:08//)

回复需要登录

9月12日 04:52 星期五

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1