价格中间有条线,就是这个价格作废,启用新的价格,这个用css样式怎么写???求指教!!!

html-css012

价格中间有条线,就是这个价格作废,启用新的价格,这个用css样式怎么写???求指教!!!,第1张

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

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

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

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 下面是案例在浏览器上运行的效果图  :

<style type="text/css">

body {

font-size:18px

}

small {font-size:14px}

-->

</style>

<body>

99<small>.23</small>

</body>