在CSS+DIV中如何做到将价格划掉的效果

html-css010

在CSS+DIV中如何做到将价格划掉的效果,第1张

1 用到的知识点是html中 tex-decoration 属性;text-decoration的属性包括 : {text-decoration:overline}

{text-decoration:line-through}

{text-decoration:underline}

{text-decoration:blink}

将价格划掉的效果  用到的是line-through值。

2 下面是tex-decoration  的使用案例,代码可以直接复制到浏览器上面进行运行。

<html>

<head>

<style type="text/css">

h2 {text-decoration: line-through}

</style>

</head>

<body>

<h2>20元</h1>

</body>

</html>

3 下面是案例在浏览器上运行的效果图  :

中间那条线叫做删除线,使用css的text-decoration:line-through就可以设置删除线,实例如下:

<span style=" text-decoration:line-throughcolor:red">199元</span><br />

<span style="font-weight:boldcolor:green">现价:99元</span>