7.11日音讯,css删除线的基础和高级应用。css的删除线在网页中应用的不是很多,可能这和不同的网站类型有关系,但在产品促销时却经常用到,如原价的数字上会加上删除线让新的价格更加明显和区分,当然它的样式也是有很多应用的方式,下面
邯郸网站建设首创网络给大家说一下它的一些应用,希望和大家一块学习。
1、CSS控制下划线出现用到地方
在DIVCSS网页中常常使用CSS代码来人对象文字内容加上下划线。
使用CSS属性单词:
text-decoration-CSS
text-decoration:none||underline||blink||overline||line-through
text-decoration下划线CSS单词值参数:
none:无装饰
blink:闪烁
underline:下划线
line-through:贯穿线
overline:上划线
text-decoration:none无装饰,通常对html下划线标签去掉下划线样式
text-decoration:underline下划线样式
text-decoration:line-through删除线样式-贯穿线样式
text-decoration:overline上划线样式
上划线、删除线、上划线CSS样式解析图:
text-decoration语法结构与值图例教程
二、HTML常规下划线标签-TOP
在HTMLu标签下划线标签“U”即可对对象文字加html下划线。
实例:
<u>我被U标签加下滑线</u>
三、CSS控制对象下划线属性样式-TOP
下面我们进行使用“U”标签和text-decoration进行设置下划线实例对比如下图
htmlu下划线与CSS下划线对比应用案例
四、CSS去掉html标签划线样式-TOP
如果我们想去掉对应html中删除线s标签删除线样式、去掉htmlu下划线、去掉html上划线样式。
1、去掉htmls删除线贯穿线样式
.divcss5s{text-decoration:none}
去掉divcss5类对象盒子里htmls标签样式属性
2、去掉htmlu下划线样式
.divcss5u{text-decoration:none}
去掉divcss5类对象盒子里u标签下划线线样式属性
五、超链接下划线高级运用-TOP
我们接下来为大家讲解常见CSS超链接,当随便经过时候文字对象被加下划线。
代码如下
<title>下划线演示www.hdscwl.com</title>
<style>
.yangshia{text-decoration:none;}
/*css注释:鼠标经过热点文字被加下划线*/
.yangshia:hover{text-decoration:underline;}
/*鼠标经过热点文字被加下划线*/
</style>
</head>
<body>
<p>
<spanclass="yangshi">
<a href="http://www.hdscwl.com">网页设计</a>
</span>
</p>
</body>
</html>
请将以上代码复制新建HTML即可查看该实例样式。更详细超链接讲解请进DIVCSS超链接。
六、完整下划线删除线上划线案例-TOP
我们进行对3个盒子对象分别设置对象内文字下划线、文字删除线样式、字体上划线样式。
1、css代码片段:
.xh01{text-decoration:underline}
.xh02{text-decoration:line-through}
.xh03{text-decoration:overline}
2、html代码片段:
<divclass="xh01">我被加下划线</div>
<divclass="xh02">我被加贯穿删除线</div>
<divclass="xh03">我被加上划线</div>大家也可以把以上代码复制下来,自己去新手应用一下,这样对知识的掌握会更加的牢固一些,好了先说到这里,如果大家有什么不明白或有好的意见欢迎大家一起沟通学习。