css 有关边框的属性_边框样式(CSS属性)
css 有关边框的属性
句法 (Syntax)
描述 (Description)
The shorthand property border-style
sets the style of the border on all four sides of an element using the values specified. Each border can have its own value—refer to the mnemonic (TRouBLe) in Shorthand Properties for an easy way to remember the shorthand order.
速记属性border-style
使用指定的值在元素的所有四个侧面上设置border-style
。 每个边框都可以有其自己的值-请参阅速记属性中的助记符(TRouBLe),以方便地记住速记顺序。
Borders are placed on top of the element’s background.
边框放置在元素背景的顶部。
例 (Example)
This style rule assigns a solid border to the top, a dashed border to the bottom, and a dotted border to the left- and right-hand sides of paragraphs within the element with ID "example"
:
此样式规则在ID为"example"
的元素内的段落的顶部分配一个实线边框,在底部分配一个虚线边框,并在左侧和右侧分配一个虚线边框:
#example p {
border-style: solid dotted dashed;
}
值 (Value)
-
none
means no border will show, and the computedborder-width
is zero.none
表示不显示任何边框,并且计算出的border-width
为零。
-
-
hidden
has the same meaning asnone
, except when it refers to table borders in cases where two cells share a border, and the table cells have collapsed borders (border-collapse:collapse;
). The valuehidden
ensures that no border is drawn, sincehidden
takes precedence over all other border styles. Ifnone
had been used for one border in the cell, the border would still be drawn, as the adjacent cell’s border would take precedence. See Table Formatting for more information.hidden
具有与none
相同的含义,除了在两个单元格共享一个边框且表单元格具有折叠边框的情况下引用表格边框时(border-collapse:collapse;
)。hidden
值确保不绘制边框,因为hidden
优先于所有其他边框样式。 如果none
为该单元格中的一个边框使用none
边框,则仍将绘制边框,因为相邻单元格的边框将优先。 有关更多信息,请参见表格式 。
-
-
dotted
implements the border as a series of dots.dotted
将边框实现为一系列点。
-
-
dashed
implements the border as a series of dashes.dashed
实现边境一系列破折号。
-
-
solid
implements the border as a solid line.solid
将边框实现为实线。
-
-
double
implements the border as two solid lines. The sum of the two border widths and the space between them equals the value that has been set forborder-width
.double
将边框实现为两条实线。 两个边框宽度的总和以及它们之间的间隔等于为border-width
设置的值。
-
-
groove
is a three-dimensional effect that gives the impression that the border is carved into the canvas.groove
是三维效果,给人的印象是将边框雕刻到画布中。
-
-
ridge
is a 3D effect that has the opposite effect ofgroove
, in that the border appears to protrude from the canvas.ridge
是3D效果,与groove
效果相反,因为边框似乎从画布突出。
-
-
inset
is a 3D effect that gives the impression that the box is embedded into the canvas. When it’s used on tables to which the separated borders model has been applied, theinset
value appears to make the whole box look as though it were embedded into the canvas. When used with the collapsing border model, it’s treated the same as the valueridge
.inset
是3D效果,给人一种将盒子嵌入画布的印象。 当在已应用分隔边框模型的表上使用它时,inset
值似乎使整个盒子看起来好像已嵌入画布中。 与折叠边框模型一起使用时,将其与ridge
值相同。
-
-
outset
is a 3D effect that has the opposite effect ofinset
in that the border gives the impression that the box protrudes from the canvas. When it’s used on tables to which the separated borders model has been applied, the border makes the whole box look as though it were coming out of the canvas. When it’s used with the collapsing border model, it behaves the same way asgroove
.outset
是3D效果,与inset
具有相反的效果,因为边框给人的印象是盒子从画布突出。 当在已应用分隔边框模型的表上使用边框时,边框使整个盒子看起来好像是从画布中出来的。 与塌陷的边界模型一起使用时,其行为与groove
相同。
-
Previously, in CSS1, user agents were allowed to interpret all dotted
, dashed
, double
, groove
, ridge
, inset
, and outset
styles as solid
.
此前,在CSS1,用户代理被允许解释所有dotted
, dashed
, double
, groove
, ridge
, inset
,并outset
样式为solid
。
翻译自: https://www.sitepoint.com/border-style-css-property/
css 有关边框的属性
css 有关边框的属性_边框样式(CSS属性)相关推荐
- css布局属性与合成属性_如何使用CSS逻辑属性控制布局
css布局属性与合成属性 CSS逻辑属性定义了一种处理布局的新方法. 他们的主要目标是帮助开发人员支持不同的书写系统,例如从右到左(RTL)和垂直显示的脚本. 这些新功能可以通过逻辑属性而不是物理属性 ...
- css中会计算的属性,css3中样式计算属性calc()的使用和总结
calc的介绍 在css3样式中有一个类似与函数的计算属性calc(),它主要用于指定元素的长度,无论是border.margin.pading.font-size和width等属性都可以使用calc ...
- css before 文字前面竖线_前端进阶: css必知的几个底层知识和技巧
学习方法推荐 问题学习法:带着问题去学习,有利于集中注意力,目的明确,这既是有意学习的要求,也是发现学习的必要条件.心理学家把注意分为无意注意与有意注意两种.有意注意要求预先有自觉的目的,必要时需经过 ...
- css中的换行符_如何使用CSS防止项目列表中的换行符?
css中的换行符 Introduction: 介绍: Dealing with various items in CSS sometimes pose very different problems. ...
- maya对象属性_了解每粒子属性和每对象属性
可以将两种类型的属性动态添加到"粒子形状"(particle shape)节点: 每粒子 每对象 每粒子属性允许您分别设定对象的每个粒子的属性值.每对象属性允许您通过单个值整体设定 ...
- 怎么用css画一个心形_如何用CSS创建心形
CSS3增强了我们仅使用HTML和CSS就能在网站上构建内容的可行性. 您可以找到我们以前精选的出色示例 . 但是,不要让自己过分领先,复杂的设计将需要可能使您头疼的代码. 取而代之的是,我们将创建一 ...
- css实现贝塞尔静态图_使用高级CSS条形图构建静态投资组合
css实现贝塞尔静态图 在上一篇文章中 ,我向您展示了如何构建漂亮的全屏投资组合页面. 在该教程中,我们还学习了如何创建响应式CSS柱形图. 在本教程中,我们将构建另一个吸引人的静态投资组合页面,这次 ...
- css 水平虚线 虚线延长_如何编辑CSS虚线轮廓
默认情况下,当锚标记元素处于active或focus状态时,在其周围会出现一条虚线,如下图所示. 对于仅通过键盘(特别是使用Tab键)访问网站的用户,此轮廓可用作视觉辅助. 它向用户显示了他们当前关注 ...
- threejs 影子属性_影子场vs.属性访问器接口第2轮
threejs 影子属性 如果你们还没有注意到Dirk Lemmerman和我之间的(轻松) 摊牌 ,那么让我快速提及一下我们是如何做到这一点的. 首先,Dirk创建了JavaFX技巧23:" ...
最新文章
- hibernate对象关系实现(二)一对一
- Linux学习记录-----《快乐的Linux命令行》.
- 单播,组播,广播的区别
- c语言 求一个数的因数,【代码】求一个数的因数和、求优化、顺便也供新人参考算法...
- 简单的C++程序题总结
- 用500行纯前端代码在浏览器中构建一个Tableau
- 程序员欢呼:微软Bing开始支持搜索源码、可直接运行
- lambda 函数式编程_Java 8 Lambda表达式的函数式编程– Monads
- vue+filter过滤器(多参数)传参 - 代码篇
- 去除报错_转录组分析 | 使用trimgalore去除低质量的reads和adaptor
- Java排序:冒泡排序
- Python之web服务利器Flask生产环境部署实践【基于gunicorn部署生产环境】
- MP算法和OMP算法及其思想与实现
- 织梦留言板模板 .php,织梦DEDECMS留言板功能制作及调用标签
- 2019北邮网安考研经验
- 服务器主板硬盘接口数量,主板上的硬盘插槽最多有几个?
- JavaScript 资源大全
- python之钉钉机器人自动发消息——傻瓜式教程
- 与我一起学习微服务架构设计模式1—逃离单体地狱
- 设计中的设计-设计究竟是什么