CSS一些常见属性的默认值

CSS3 动画属性(Animation)

属性名称默认值
animationnone 0 ease 0 1 normal

默认值对应的6个属性依次为:

  • animation-name
  • animation-duration
  • animation-timing-function
  • animation-delay
  • animation-iteration-count
  • animation-direction

CSS 背景属性(Background)

属性名称默认值
background-colortransparent
background-imagenone

CSS border 属性

属性名称默认值
bordernot specified(未指定)

Color 属性

属性名称默认值
opacity1

CSS 尺寸属性(Dimension)

属性名称默认值
heightauto(默认,浏览器会计算出实际的高度)
max-heightnone
max-widthnone
min-height0
min-width0
widthauto(默认,浏览器会计算出实际的宽度)

CSS 字体属性(Font)

属性名称默认值
fontnot specified(未指定)
font-familynot specified(未指定)
font-sizemedium
font-stylenormal
font-weightnormal

CSS 列表属性(List)

属性名称默认值
list-styledisc outside none

默认值对应的3个属性依次为:

  • list-style-type
  • list-style-position
  • list-style-image

CSS 外边距属性(Margin)

属性名称默认值
margin0

CSS 内边距属性(Padding)

属性名称默认值
padding0

CSS 定位属性(Positioning)

属性名称默认值
floatnone
clearnone
cursorauto(默认,浏览器设置的光标)
displaystatic
overflowvisible(默认值,内容不会被修剪,会呈现在元素框之外)
vertical-alignbaseline(默认,元素放置在父元素的基线上)
z-indexauto(默认,堆叠顺序与父元素相等)
topauto(默认值,通过浏览器计算边缘的位置)
rightauto(默认值,通过浏览器计算边缘的位置)
bottomauto(默认值,通过浏览器计算边缘的位置)
leftauto(默认值,通过浏览器计算边缘的位置)

CSS 文本属性(Text)

属性名称默认值
colornot specified(未指定)
directionltr(默认,文本方向从左到右)
letter-spacingnormal
line-heightnormal
text-align如果 direction 属性是 ltr,则默认值是 left;如果 direction 是 rtl,则为 right
text-transformnone
text-outlinenone
text-shadownone
text-wrapnormal(只在允许的换行点进行换行)

2D/3D 转换属性(Transform)

属性名称默认值
transformnone

过渡属性(Transition)

属性名称默认值
transitionall 0 ease 0

默认值对应的4个属性依次为:

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

用户界面属性(User-interface)

属性名称默认值
box-sizingcontent-box(这是由 CSS2.1 规定的宽度高度行为。宽度和高度分别应用到元素的内容框。在宽度和高度之外绘制元素的内边距和边框)
  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值