CSS属性

将自己常用的做了个整理,后期继续补全。

属性名称

属性

属性值

备注

颜色属性

color

red  blue

 

 

背景图片

 

background-image

url=""

body{ background-image:url(11.jpg);}

 

 

背景图片重复

 

 

background-repeat

repeat

 

repeat-x

 

repeat-y

 

no-repeat

 

inherit

 

 

背景图片附着

 

background-attachment

scroll

随着网页滚动

fixed

固定

inherit

继承父类

 

背景图片定位

 

background-position

x y

坐标

top center bottom

left center right

关键字

背景颜色属性

background-color

red  yellow

 

边框宽度

border-width

thin medium thick

table{

border-top:5px solid black;

border-left:5px solid black;

cursor:default;

align:center;}

border-top-width

设置上边框

border-right-width

设置右边框

border-bottom-width

设置下边框

border-left-width

设置左边框

边框颜色

border-color

参考color的值

 

 

 

 

 

边框的风格

 

 

 

 

border-style

none 无样式

 

hidden 隐藏

 

dashed 虚线

 

solid  实体的

 

double 双线

 

groove 凹的

 

ridge  山脊

 

inset   内凹

 

outset  外凸

 

dotted 点线

 

 

 

边界距margin

margin-top

设置上边界

 

margin-right

设置右边界

 

margin-bottom

设置下边界

 

margin-left

设置左边界

 

margin

top right bottom left

margin:30 30 30 30;

 

 

填充padding

内容距离边框的距离

padding-top

设置上填充

 

padding-right

设置右填充

 

padding-bottom

设置下填充

 

padding-left

设置左填充

 

padding

top right bottom left

.image{padding:10 20 10 20;}

字体名称

font-family

times serif courier Verdana

 

字体风格

font-style

italic/oblique/nomal

斜体、正常

 

 

 

字体粗细程度

 

 

 

font-weight

normal

p{

font-family:

Verdana;

font-style:

 italic;

font-weight:

normal;}

bold

bolder

lighter

100-900

 

 

字体大小

 

 

font-size

12pt

pt   point 

12px

px  pixel 像素

medium smaller larger  25%

 

行间距

line-height

14px

 

字体变量

font-variant

small-caps/normal

字体变大

font-variant:small-caps;

文本缩进

text-indent

50px  60%

可以是 -40 负值

文本对齐

text-align

left

 

right

 

center

 

justify

两边对齐

文本装饰效果

text-decoration

none

无装饰

underline

下划线

overline

上划线

line-through

删除线

BlinkFirefox

闪烁

文本变形

text-transform

none

不变

capitalize

首字母大写

uppercase

全部大写

font-variant:small-caps;

lowercase

全部小写

 

display

None

隐藏

Inline

横着显示

block

 

链接属性

a:link{...}

未访问链接属性

a:hover{

color:yellow;}

a:active{

background-color:green;}

a:visited{...}

访问链接属性

a:active{...}

鼠标点击和释放之间时

a:hover{...}

鼠标悬停时

手型

cursor

 

十字准心 cursor: crosshair;   cursor: pointer;  cursor: hand。  

等待/沙漏 cursor: wait;   帮助 cursor: help;   无法释放 cursor: no-drop;   文字/编辑 cursor: text;   可移动对象 cursor: move;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值