div_style常用属性预案.docVIP

  • 3
  • 0
  • 约 20页
  • 2016-10-30 发布于湖北
  • 举报
div style常用属性 一、常用属性: 1、Height:设置DIV的高度。 2、Width:设置DIV的宽度。 例: ? ? div style=width:200px;height:200px;background-color:Black; /div 复制代码 ? ? ? 3、margin:用于设置DIV的外延边距,也就是到父容器的距离。 ?例: ? 1 div style=background-color:Black;width:500px;height:500px; 2 3 div style=margin:5px 10px 20px 30px;width:200px; height:200px;background-color:White; 4 5 /div 6 7 ?/div 复制代码 ? ? ? 说明:margin:后面跟有四个距离分别为到父容器的上-右-下-左边的距离;可以看例子中的白色DIV到黑色DIV的边距离效果。还可以分别设置这四个边的距离,用到的属性如下: 4、margin-left:到父容器左边框的距离。 5、margin-right:到父容器右边框的距离。 6、margin-top:?到父容器上边框的距离。 7、margin-bottom:到父容器下边框的距离。 例: ? 代码 1 div style=width:500px;hei

文档评论(0)

1亿VIP精品文档

相关文档