CSS

选择器

css中的选择器

背景颜色、图像

background background-attachment background-clip background-color background-image background-origin backgrond-position background-repeat background-size

文字、字体

color font font-family font-size font-size-adjust font-style font-variant font-weight

文档格式

hanging-punctuation hyphens letter-spacing line-height text-align text-decoration text-indent text-overflow text-shadow text-transform white-space word-spacing word-wrap

宽度和高度

width,height max-width min-width max-height min-height

外缘与内缘余白

margin margin-bottom margin-left margin-right margin-top padding padding-bottom padding-left padding-right padding-top

边框

border border-bottom border-color border-style border-width border-top border-right border-left

边框圆角

border-radius border-bottom-right-radius border-bottom-left-radius border-top-right-radius border-top-left-radius

边框图像

border-image border-image-repeat border-image-slice border-image-source border-image-width

容器与弹性容器

bottom clear clip box-decoration-break box-shadow align-content align-items align-self display flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content float left outline-offset overflow overflow-x overflow-y order position right resize top vertical-align z-index

透明

opacity rgba

渐变

linear-gradient radial-gradient

文章分栏

break-after break-before break-inside columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width

时间过渡效果

transition transition-delay transition-duration transition-property transition-timing-function

动漫效果

@keyframes animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function

2D、3D变形

transform translate matrix2d matrix3d perspective scale skew rotate transform-origin

颜色、尺寸、单位

角度与URL 颜色 单位长度

表格

border-collapse border-spacing caption-side empty-cells table-layout

列表

counter-increment counter-reset list-style list-style-type list-style-image list-style-position

基本的用户界面属性

box-sizing content cursor nav-index nav-left nav-down nav-right nav-up

CSS基础

border-style(边线的样式)

border-style: 值;

border-style: solid;

border-style属性用于指定边线的样式,有多个值时,值之间用半角空格间隔。

值得个数及含义

  • 1个值:上下左右的样式
  • 2个值:上下、左右的样式
  • 3个值:上、左右、下的样式
  • 4个值:上、右、下、左的样式

也可以使用border-left-style属性、border-bottom-style属性、border-right-style属性、border-top-style属性分别指定左边线、底边线、右边线、顶线的样式。

border-style的值及其说明
属性 说明
borde-style none 不显示边线,宽度为0,如果表格单元格边线等重叠时,优先使用其他值,该值为默认值。
hidden 不显示边线,宽度为0,如果表格单元格边线等重叠时,优先该值。
solid 表示1条直线
double 表示2条直线,即:双线
groove 表示立体下陷直线
ridge 表示立体隆起直线
inset 上边线与左边线为暗色,下边线与右边线为亮色,边线围绕的区域呈现立体感。
outset 上边线与左边线为亮色,下边线与右边线为暗色,边线围绕的区域呈现立体感。
dashed 表示破线
dotted 表示点线

css文件

.sample1,.sample2,.sample3,.sample4,.sample5,.sample6,.sample7,.sample8,

.sample9,.sample10,.sample11,.sample12,.sample13{

margin:0.5em;

padding:2px;

border-color:#ffff00;

border-width:5px;

}

.sample1 {border-style: none;}

.sample2 {border-style: hidden;}

.sample3 {border-style: solid;}

.sample4 {border-style: double;}

.sample5 {border-style: groove;}

.sample6 {border-style: ridge;}

.sample7 {border-style: inset;}

.sample8 {border-style: outset;}

.sample9 {border-style: dashed;}

.sample10 {border-style: dotted;}

.sample11 {border-style: solid double;}

.sample12 {border-style: solid double groove;}

.sample13 {border-style: solid double groove ridge;}

链接了上述css文件的html文件

<!DOCTYPE html>

<html lang="zh">

<head>

<meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1">

<link href="material/border-style.css" rel="stylesheet" type="text/css" />

<title>border-style属性</title>

</head>

<body>

<div class="sample1">sample1:none</div>

<div class="sample2">sample2:hidden</div>

<div class="sample3">sample3:solid</div>

<div class="sample4">sample4:double</div>

<div class="sample5">sample5:groove</div>

<div class="sample6">sample6:ridge</div>

<div class="sample7">sample7:inset</div>

<div class="sample8">sample8:outset</div>

<div class="sample9">sample9:dashed</div>

<div class="sample10">sample10:dotted</div>

<div class="sample11">sample11:上下solid、左右double</div>

<div class="sample12">sample12:上solid、左右double、下groove</div>

<div class="sample13">sample13:上solid、右double、下groove、左ridge</div>

</body>

</html>

浏览器上的显示结果↓

 border-style属性
sample1:none
sample2:hidden
sample3:solid
sample4:double
sample5:groove
sample6:ridge
sample7:inset
sample8:outset
sample9:dashed
sample10:dotted
sample11:上下solid、左右double
sample12:上solid、左右double、下groove
sample13:上solid、右double、下groove、左ridge

浏览器支持情况

属性
border-style yes yes yes yes yes

注:上表中的数字为开始支持该当属性的浏览器版本。

关联内容