css之top,right,bottom,left

来源:互联网 发布:神话刷号软件 编辑:程序博客网 时间:2024/05/29 18:13

在控制盒子模型大小、方位时最常用的莫过于这四个方向:上,右,底,左。鉴于css规定一群操蛋的赋值方法,在此以博客记录一下,以免一忘再忘^_^

以margin为例:

元素名称{margin:n个值}

n为4:依次顺序为top   right   bottom   left

n为3:top   left and right   bottom

n为2:top and bottom   left and right

n为1:上下左右一个值

以上,单位为px,注意数值之间留一个空格即可,不要填逗号,否则会报错


0 0
原创粉丝点击