html中hr标签的各种用法
https://www.yisu.com/zixun/119190.html
html中hr标签定义和用法:
<hr> 标签在 HTML 页面中创建一条水平线。
水平分隔线(horizontal rule)可以在视觉上将文档分隔成各个部分。
HTML <hr> 标签实例:
被水平线分隔的标题和段落:
1 2 3 | < h2 >This is header 1</ h2 > < hr /> < p >This is some text</ p > |
html中hr标签可选的属性:
html中hr标签在网页中的用法:
1 2 3 4 5 6 7 8 | < hr align="center"> < hr align="left"> < hr align="right"> < hr noshade="true"> < hr noshade="false"> < hr size="5"> < hr width="500px"> < hr align="left" noshade="false" size="4" width="500px" color="#ff0000"> |
html中hr标签的各种样式使用:
网页设计当中hr的各种样式,如果使用得当,将会给你的页面增色很多,下面就来详细介绍下各种样式和各种使用方式的方法!
我用的编辑器是eclipse,这个根据个人喜好来定,用什么都无所谓的,就算你直接用txt也照样能实现这里的效果,毕竟只是静态。
第一种:
1 | < hr style=" height:2px;border:none;border-top:2px dotted #185598;" /> |
height:2px;是hr的高度
border:none;是没有边框
border-top:2px dotted #185598;是设置横线的样式
dotted 虚线 #185598 颜色
第二种:
1 | < hr style="height:1px;border:none;border-top:1px dashed #0066CC;" /> |
第三种:
1 | < hr style="height:1px;border:none;border-top:1px solid #555555;" /> |
第四种:
1 | < hr style="height:3px;border:none;border-top:3px double red;" /> |
html中hr的各种样式使用
第五种:
1 | < hr style="height:5px;border:none;border-top:5px ridge green;" /> |
第六种:
1 2 | < hr style="height:10px;border:none;border-top:10px groove skyblue;" /> border-top:10px groove skyblue; groove 上颜色 skyblue 下颜色 |
渐变颜色的分隔线:
1 2 | < hr style="filter:alpha(opacity=5,finishopacity=100,style=1);height:10px" color=green> < hr style="filter:alpha(opacity=100,finishopacity=5,style=1);height:10px" color=blue> |
中心透明的分隔线:
1 2 | < hr style="filter:alpha(opacity=0,finishopacity=100,style=2);height:12px" color=orange> < hr style="filter:alpha(opacity=0,finishopacity=100,style=3);height:12px" color=#FF00FF> |
中心不透明的分隔线:
1 2 | < hr style="filter:alpha(opacity=100,finishopacity=0,style=2);height:15px" color=yellow> < hr style="filter:alpha(opacity=100,finishopacity=0,style=3);height:15px" color=#00FFFF> |
波浪线:
1 | < hr style="filter:wave(strength=9,freq=2,lightstrength=20,phase=9);height:15px" color=pink width=95%> |
三色线:
1 | < hr style="border-top: #ff0000 solid; color: #00ff00; border-bottom: #0000ff solid; height: 9px"> |
虚线:
1 | < hr style="border-top: 2px dashed; border-bottom: 2px dashed; height: 2px" color=black> |
竖线:
1 2 3 | < hr style="height:100px; width:4px" color=orange> < hr style="filter:alpha(opacity=100,finishopacity=5,style=2); height:100px; width:5px" color=navy> < hr style="filter:alpha(opacity=0,finishopacity=100,style=2);height:100px; width:4px" color=red> |
HTML 与 XHTML 之间的差异
在 HTML 中,<hr> 标签没有结束标签。
在 XHTML 中,<hr> 必须被正确地关闭,比如 <hr />。
在 HTML 4.01 中,hr 元素的所有呈现属性均不被赞成使用。
在 XHTML 1.0 Strict DTD 中,hr 元素的所有呈现属性均不被支持。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· Obsidian + DeepSeek:免费 AI 助力你的知识管理,让你的笔记飞起来!
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了