CSS3 各种属性设置

字体api

font-size字体

    smaller|small|medium|large|largerspa

    Npxorm

    N% 相对于父元素字体大小的百分比ip

font-variantci

    normal     大写变小写it

    small-caps 小写变大写io

font-styleform

    normal容器

    italic 倾斜

font-weight

    normal|bold|bolder|lighter

    100~900 (bold if > 600)

font-family 字体

文本

text-decoration

    underline

    overline

    line-through

    blink [not used]

text-transform

    uppercase

    lowercase

    capitalize

text-shadow

    N N N COLOR 分别表明

    水平偏移 垂直偏移 阴影模糊度 阴影颜色

text-align

    left|right|center

    justify 两端对齐

    start 开始边界

    end 结束边界

white-space 处理空白排版的方式

    normal 空白符被压缩 文本自动换行

    nowrap 空白符被压缩 文本不换行

    pre 空白符被保留 遇换行符则换行

    pre-line 空白符被压缩 文本排满或遇换行符时换行

    pre-wrap 空白符被保留 文本排满或遇换行符时换行

letter-spacing 文本间距 Npx

word-spacing 英文单词间距 Npx

line-height 段落行高 Npx | % 例如%200

word-wrap 过长的英文单词断开 break-word

text-indent 文本首行缩进 Npx

盒模型

大小 [max|min]<-><width|height> 

padding 内边距

magrin 外边距

overflox 溢出 overflow-[x|y]

    auto 溢出显示滚动条

    hidden 切掉溢出内容

    scroll 出现滚动条

    visible 不论是否溢出都显示内容 默认

visibility 可见

    visible 可见 默认

    hidden 不可见但占据空间

    collapse 不可见 隐藏表格行和列 不是表格则同hidden

display 元素级别 行内元素表明 <span> 块级元素表明 <div>

    block 块级

    inline 行内

    inline-block 行内块级

    none 不可见 不占位

float 元素浮动

    left | right | none

clear 浮动堆叠处理

    none 容许两边浮动

    left 禁止左浮动

    right 禁止右浮动

    both 禁止两边浮动

边框 border [width style color]

    border-width 大小

        thin|medium|thick

        Npx

    border-style 样式

        dashed | dotted | double | groove

        inset | outset | ridge | solid

    border-color 颜色

    单独设置边线 border-<left|right|top|bottom>-<width|style|color>

    border-radius 边框圆角

    border-<bottom|top>-<left|right>-radius

background 背景

    background-color

    background-image URL

    background-repeat

        repeat[-<x|y>]

        no-repeat

    background-position

        <top | left | right | bottom | center>

        Npx | %

    background-size

        cover 等比例缩放图像 有可能超出容器

        contain 等比例缩放图像 使宽度|高度较大者重合容器边界

    background-attachment

        scroll 背景固定在容器上 不会随内容一块儿滚动 默认

        fixed 背景固定在视窗上 内容滚动时背景不动

    background-origin 绘制背景

        border-box 盒子内部绘制背景

        padding-box 盒子内边距绘制背景

        content-box 盒子内部绘制背景

    background-clip 裁剪背景

        border-box

        padding-box

        content-box

相关文章
相关标签/搜索