本文摘自PHP中文网,作者奋力向前,侵删。
之前的文章《html网页中如何实现居中效果(代码分享)》中,给大家介绍了如何让网页整体居中。下面本篇文章给大家介绍怎样使用css给HTML元素字体添加边框效果,我们一起看看怎么做。
html元素添加边框用border属性来实现。
border 简写属性在一个声明设置所有的边框属性。
border属性的三要素
border-width
默认是 1px
border-style
边框样式
border-color
默认是黑色
border-style
设置边框的样式可选
代码示例
1 2 3 4 5 6 7 8 9 10 11 12 | < 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 >
|
代码效果
方法步骤
阅读剩余部分
相关阅读 >>
css元素如何重叠?
html ul标签的什么意思?html ul标签的作用详解
什么是css样式层叠表
html怎么定位
css如何设置文本颜色
如何建立纯css的滑块
css实现禁止选中文本
css 背景不滚动的实现方法
关于html中area标签的用法详解
html如何实现文本上下居中
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » 手把手教你使用css给HTML字体添加边框效果(代码分享)