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基础

caption-side(表格标题的位置)

caption-side: top | bottom | initial | inherit;

使用caption-side属性指定表格标题的位置。

属性的值及其说明
说明 实例
top 标题位于表格的上部 实例
bottom 标题位于表格的下部
initial 保持原有属性的值
inherit 继承母元素的设定。
默认值:top
值的继承:继承
版本:CSS2
JavaScript语法: object.style.captionSide="bottom"

CSS文件

table.sample {

border: solid 1px #000;

border-collapse: separate;

}

td.sam{border: solid 1px #ff0000;}

caption.sam1{

caption-side: top;

}

caption.sam2{

caption-side: bottom;

}

HTML文件

<!DOCTYPE html>

<html lang="zh">

<head>

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

<link href="material/caption-side.css" rel="stylesheet" type="text/css" />

</head>

<body>

<table class="sample">

<caption class="sam1">标题</caption>

<tr><td class="sam">单元格1</td><td class="sam">单元格2</td></tr>

<tr><td class="sam">单元格3</td><td class="sam">单元格4</td></tr>

</table>

<br>

<table class="sample">

<caption class="sam2">标题</caption>

<tr><td class="sam">单元格1</td><td class="sam">单元格2</td></tr>

<tr><td class="sam">单元格3</td><td class="sam">单元格4</td></tr>

</table>

</body>

</html>

浏览器上的显示结果↓

标题
单元格1单元格2
单元格3单元格4

标题
单元格1单元格2
单元格3单元格4

不同浏览器上的属性的书写方法及对应情况

属性
caption-side 8.0 1.0 1.0 1.0 4.0

补充说明:如果IE8支持该属性,文档声明必须是!DOCTYPE。

关联内容