论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > div+css布局教程
Tag:css,入门,技巧,div,实例,示例,菜单,布局,web2.0,ul,li,经验,列表,web标准,xhtml,web标准,浏览器,兼容,css hack,表格,视频教程

{CSS}css教程:CSS边距margin属性的应用

文章类别:div+css布局 | 发表日期:2008-9-26 11:33:08

The CSS margin properties define the space around elements.
CSS的边距属性定义元素四面的空间范围


设置文字左边距 Set the left margin of a text
This example demonstrates how to set the left margin of a text.
Examples 实例:
div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]


设置文字右边距 Set the right margin of a text
This example demonstrates how to set the right margin of a text.
Examples 实例:
div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]


设置文字顶边距 Set the top margin of a text
This example demonstrates how to set the top margin of a text.
Examples 实例:
div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]


设置底部边距 Set the bottom margin of a text
This example demonstrates how to set the bottom margin of a text.
Examples 实例:
div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]


快速设置四边边距 All the margin properties in one declaration
This example demonstrates how to set a shorthand property for setting all of the margin properties in one declaration.
Examples 实例:
div css xhtml xml Source Code to Run Source Code to Run [www.21shipin.com]

[ 可先修改部分代码 再运行查看效果 ]


The CSS margin properties define the space around elements. It is possible to use negative values to overlap content. The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used to change all of the margins at once.
CSS边距定义元素四面的空间范围。它可让内容重叠。也可用分离的属性分别对上,下,左,右进行样式改变。用margin属性可以快速的设置所有边距。

Note: Netscape and IE give the body tag a default margin of 8px. Opera does not! Instead, Opera applies a default padding of 8px, so if one wants to adjust the margin for an entire page and have it display correctly in Opera, the body padding must be set as well!
注重: 网景和IE默认给body标签加上了8px的边距。OPERA就没有这样的情况,相反的,OPERA有个默认的8px填充,所以要让页面在几个不同主流浏览器上的效果都相同就需要将属性设置妥当!
视频教程列表
文章教程搜索
 
div+css推荐教程
div+css热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058