-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
CSS模型CSS模型相关CSS模型相关
Description
1. 文本
color:rgb | rgba | hsl | hsla
direction: ltr | rtl
line-height:设置多行元素的空间量,比如文本。
text-align:定义行内内容(例如文字)如何相对它的块父元素对齐。start | end | left | right | center | justify | justify-all | match-parent
text-justify:只有 text-align: justify; 才会生效
vertical-align:指定行内元素(inline)或表格单元格(table-cell)元素的垂直对齐方式
text-indent:规定了 一个元素首行文本内容之前应该有多少水平空格。
text-decoration:用于设置文本排版(下划线、顶划线、删除线或者闪烁)。
text-decoration-[color, line, style]:line——none、underline、overline、line-through;style——solid、double、dotted、dashed、wavy
text-shadow:为文字添加阴影。
text-transform,大小写。none | capitalize | uppercase | lowercase | full-width
white-space:设置如何处理元素中的空白。normal | pre | nowrap | pre-wrap | pre-line
word-spacing:声明标签和单词直接的间距行为。normal | <length> | <percentage>
letter-spacing:明确了文字的间距行为。normal | <length>
换行相关:
word-break:单词内断行。normal | break-all | keep-all | break-word
overflow-wrap(word-wrap):用来说明当一个不能被分开的字符串太长而不能填充其包裹盒时,为防止其溢出,浏览器是否允许这样的单词中断换行。normal | break-word
hyphens:连字符。none | manual | auto
line-break:指定如何断行拉丁文字。 auto | loose | normal | strict
与word-break不同的是,overflow-wrap只会在整个单词没有溢出的情况下才会创建一个断行。
2. 字体
font
font-family:<family-name>, <generic-name>。serif——带衬线字体;sans-serif——无衬线字体;monospace——等宽字体;cursive——草书字体;fantasy——艺术字体。
font-size:xx-small, x-small, small, medium, large, x-large, xx-large, larger, smaller
font-size-adjust:定义字体大小应取决于小写字母,而不是大写字母。
font-stretch
font-style:normal | italic | oblique
font-variant:设置或检索对象中的文本是否为小型的大写字母。normal | small-caps
font-weight:粗细程度。normal | bold | lighter | bolder
3. 列表
list-style
list-style-image:指定一个能用来作为列表元素标记的图片。<url> | none
list-style-position:inside | outside
list-style-type:指定一个列表元素的外观。none | disc | circle | square | decimal(默认) | decimal-leading-zero
4. 表格
border-collapse:决定表格的边框是分开的还是合并的。 separate | collapse
border-spacing:指定相邻单元格边框之间的距离。
caption-side:将表格的标题<caption> 放到规定的位置。top | bottom | block-start | block-end | inline-start | inline-end
empty-cells:定义了用户端 user agent 应该怎么来渲染表格 <table> 中没有可见内容的单元格的边框和背景。show | hide
table-layout:定义了用于布局表格单元格,行和列的算法。auto | fixed
vertical-align:指定行内元素(inline)或表格单元格(table-cell)元素的垂直对齐方式。baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>
5. 轮廓
outline:<outline-color> | <outline-style> | <outline-width>
outline-color:<color> | invert
outline-style:none | dotted | dashed | solid | double | groove | ridge | inset | outset | inherit
outline-width:thin | medium | thick | <length>
6. 定位
position:static | relative | absolute | fixed | sticky
top、bottom、left、right
7. 行内元素
vertical-align:指定行内元素(inline)或表格单元格(table-cell)元素的垂直对齐方式。初始值是baseline。baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>
text-align:定义行内内容(例如文字)如何相对它的块父元素对齐,并不控制块元素自己的对齐,只控制它的行内内容的对齐。start | end | left | right | center | justify | match-parent
8. 背景
background:
background-attachment:如果指定了background-image,那么该属性决定背景是在视窗中固定还是随包含它的区块滚动。scroll(相对于元素本身固定) | fixed(相对视窗固定) | local(相对于元素的内容固定) | inherit
background-color:在指定的图像的下面
background-image:先指定的图像会在之后指定的图像上面绘制。url("RUL")
background-repeat:属性定义背景图像的重复方式。repeat-x | repeat-y | repeat | space | round | no-repeat
background-size:设置背景图片大小。auto | cover | contain | <length> | <percentage>
background-clip:裁剪边界,设置元素的背景(背景图片或颜色)是否延伸到边框下面。border-box | padding-box | content-box | text
background-origin:图像起始位置,规定了指定背景图片background-image 属性的原点位置的背景相对区域。border-box | padding-box | content-box
background-position:指定背景图片的初始位置,以origin为基准,可以给多背景设置。<position> | [水平偏移,垂直偏移]
9. 边框
border
border-[top, bottom, left, right]
border-[top, bottom, left, right]-[color, style, width]
border-[top, bottom]-[left, right]-radius
border-color
border-style
border-width
border-image
border-image-[outset, repeat, slice, source, width]
10. 图片
同行内元素;
但是作为盒模型的背景,会更灵活;
过滤器(filter)产生特效。
object-fit,替换元素该如何调整大小来适应容器
11. 其他
cursor:光标属性
quotes:引号,open-quote、close-quote、no-close-quote
counter-reset:重置
counter-increment:递增
12. 伪类
:active,当用鼠标交互时,它代表的是用户按下按键和松开按键之间的时间。
:empty,代表没有子元素的元素。子元素只可以是元素节点或文本(包括空格)。注释或处理指令都不会产生影响。
:focus
:focus-within,元素自身或者它的某个后代匹配:focus伪类。
:hover
:link
:not()
:visited
:target,匹配URL的一个片段 (以#标识的)
:root,匹配文档树的根元素。对于HTML来说是<html>元素
表单相关:
:checked
:default
:disabled
:enabled
:in-range
:out-of-range
:invalid
:valid
:required
:read-only
:read-write
定位元素:
:first-child
:first-of-type
:last-child
:last-of-type
:nth-child()
:nth-last-child()
:nth-last-of-type()
:nth-of-type()
:only-child
:only-of-type
13. 伪元素
::before
::after
::first-letter
::first-line
::selection,应用于文档中被用户高亮的部分
14. 盒模型
overflow:visible | hidden | scroll | auto | overlay
遮盖和裁剪
clip-path:创建一个只有元素的部分区域可以显示的剪切区域
mask:遮盖
参考
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CSS模型CSS模型相关CSS模型相关