当前位置:软件学堂 > 资讯首页 > 网络编程 > DIV+CSS > css margin-left左侧边界属性

css margin-left左侧边界属性

2012/11/26 19:09:48作者:佚名来源:网络

移动端

【实例介绍】

css margin-left左侧边界属性

margin-left属性设置元素的左外边距。

【基本语法】

margin-left:length

【语法介绍】

检索或设置对象左边的外延边距。

【实例代码】

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> p.leftmargin {margin-left: 2cm} </style> </head> <body> <p>这个段落没有指定外边距。</p> <p class="leftmargin">这个段落带有指定的左外边距。</p> </body> </html>

【代码分析】

在代码中,加粗部分的标记是设置左外边距,在浏览器中预览,效果如图所示。

左侧边界属性margin-left运行效果

【素材及源码下载】

请点击:左侧边界属性css margin-left 下载本实例相关素材及源码

 

标签: 属性