jsjquery 怎么让文本域选中的内容加背景和横线,急急急...最好要兼容的

JavaScript07

jsjquery 怎么让文本域选中的内容加背景和横线,急急急...最好要兼容的,第1张

$("#id").css({"background":"#CCC","text-decoration":"line-through"})

这个就是向id元素加了#CCC的灰色背景,line-through就是文字的删除线(画在中间的),underline的话就是下划线。

<p>hr控制

<!-- width控制线的长度size控制线的粗细 -->

横线:<hr width=500 size=0 color="#999999">

<!-- width控制线的宽度,size控制线的长短 -->

横线<br><div style="position:relative width:600 height:1px background-color:red"></div>

<div style="background:#fff

text-align: center

margin:0 auto

margin-bottom:-18px

width: 90px

position:relative

">XXXXXXXXX</div><hr/>

扩展资料

在网页中画一条竖线

1<div style="width:1000height:1border-top:1px dotted #000000"></div>2<s

style="width:1000height:1border-top:1px dotted #000000"></s>3<b

style="width:1000height:1border-top:1px dotted #000000"></b>4<input

style="width:1000height:1border-top:1px dotted #000000">5<a

style="width:1000height:1border-top:1px dotted #000000"></a>6<center

style="width:1000height:1border-top:1px dotted #000000"></center>7<iframe

style="width:1000height:1border-top:1px dotted #000000" frameborder=no>

</iframe>8<img style="width:1000height:1border-top:1px dotted #000000">

</img>9<hr size="1" noshade style="height:100width:1border:1px dotted

#000000zoom:2">线条长度=zoom*height10<hr size="1" noshade style="border:1px

dotted #000000">部分不能显示请装IE5.5+