小白教程
所有教程
关于
Search
172.70.100.162
172.70.100.162
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Pr margin top”的源代码
本页内容
上一节:
Pr_margin_right
下一节:
Css3_pr_column_count
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:margin-top}}[[Category:css reference|148]] = CSS margin-top 属性 = 设置一个p元素的上部边距: <sample title="" desc="" lang="html" hererun="1"> p { margin-top:2cm; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> p.ex1 {margin-top:2cm;} </style> </head> <body> <p>一个没有指定边距大小的段落。</p> <p class="ex1">一个2厘米上边距的段落。</p> <p>一个没有指定边距大小的段落。</p> </body> </html> </run> == 属性定义及使用说明 == margin-top属性设置元素的上部边距。 '''注意:''' 负值是允许的。 {| class="table table-striped table-hover" | 默认值: | 0 |- | 继承: | no |- | 版本: | CSS1 |- | JavaScript 语法: | object.style.marginTop="10px" |} == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 属性 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | margin-top | 1.0 | 6.0 | 1.0 | 1.0 | 3.5 |} == 属性值 == {| class="table table-striped table-hover" ! 值 ! 描述 |- | auto | 浏览器设置的上外边距。 |- | length | 定义固定的上外边距。默认值是 0。 |- | % | 定义基于父对象总宽度的百分比上外边距。 |- | inherit | 规定应该从父元素继承上外边距。 |} == 相关文章 == CSS 教程: [[css margin|CSS Margin]]
返回至“
Pr margin top
”。
上一节:
Pr_margin_right
下一节:
Css3_pr_column_count