html怎么设置边框为虚线

发布时间:2022-04-27 15:50:28 作者:iii
来源:亿速云 阅读:2087

这篇文章主要介绍了html怎么设置边框为虚线的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇html怎么设置边框为虚线文章都会有所收获,下面我们一起来看看吧。

html设置边框为虚线的方法是,给边框添加border-style属性,并且设置属性值为dashed就可以了,例如【p.dashed {border-style:dashed;}】。

本文操作环境:windows10系统、html 5、thinkpad t480电脑。

我们可以利用border-style属性来设置边框的样式,使用此属性你会发现设置边框为虚线是非常简单的。

可能有不少同学不太熟悉border-style属性,下面我们来一起看看该属性吧。

border-style属性设置一个元素的四个边框的样式。

常用的属性值有:

代码示例:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
<style>
p.none {border-style:none;}
p.dotted {border-style:dotted;}
p.dashed {border-style:dashed;}
p.solid {border-style:solid;}
p.double {border-style:double;}
p.groove {border-style:groove;}
p.ridge {border-style:ridge;}
p.inset {border-style:inset;}
p.outset {border-style:outset;}
p.hidden {border-style:hidden;}
</style>
</head>

<body>
<p class="none">无边框。</p>
<p class="dotted">虚线边框。</p>
<p class="dashed">虚线边框。</p>
<p class="solid">实线边框。</p>
<p class="double">双边框。</p>
<p class="groove"> 凹槽边框。</p>
<p class="ridge">垄状边框。</p>
<p class="inset">嵌入边框。</p>
<p class="outset">外凸边框。</p>
<p class="hidden">隐藏边框。</p>
</body>

</html>

运行结果如下所示:

html怎么设置边框为虚线

关于“html怎么设置边框为虚线”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“html怎么设置边框为虚线”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。

推荐阅读:
  1. css中设置边框虚线样式的方法
  2. css设置虚线边框的方法是什么

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

html

上一篇:HTML里如何放视频

下一篇:HTML代码怎么制作滚动文字

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》