CSS怎么给数字中间加一横线

html-css014

CSS怎么给数字中间加一横线,第1张

2种方法:

1、给这个数字添加css属性:text-decoration: line-through

2、给这个数字添加标签:del。如:<del>9999</del>。

text-decoration详解:

text-decoration : none || underline || blink || overline || line-through

none :  无装饰。text-decoration:none 无装饰,通常对html下划线标签去掉下划线样式。

blink :  闪烁

underline :  下划线。text-decoration:underline 下划线样式。

line-through :  贯穿线。text-decoration:line-through 删除线样式-贯穿线样式。

overline :  上划线。text-decoration:overline 上划线样式。

扩展资料:

我们进行对3个盒子对象分别设置对象内文字下划线、文字删除线样式、字体上划线样式。

1、css代码片段:

.divcss5{text-decoration:underline}

.divcss5_1{text-decoration:line-through}

.divcss5_2{text-decoration:overline} 

2、html代码片段:

<div class="divcss5">我被加下划线</div>

<div class="divcss5_1">我被加贯穿删除线</div>

<div class="divcss5_2">我被加上划线</div>

什么汉字可以,数字不行了?首先你得知道什么是竖向排列

第二张图是正确的竖向排列

第一张图数字是顺时针旋转了90°汉字是竖向排列的

方法一图片去做

方法二用用css3把数字旋转transform:rotate(90deg),汉字竖向排,你是限制宽度还是用其他方法都可以。

备注(我没试过,但是应该还会有其他问题,本人觉得这种动态文字排版不合理)

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<script>标签中,输入js代码:

$('td').click(function () {

$('td').css('font-weight', 'normal')

$(this).css('font-weight', 'bold')

})

3、浏览器运行index.html页面,点击“我是A”,此时字体会变粗。

4、再点击“我是B”,此时“我是A”的字体粗度恢复正常,“我是B”的字体变粗。