| ///pc/img/blank.gif" width="12" height="8">当前位置:///default.htm" class="under">亿度网络 -> ///pc/index.htm" class="under">网页制作教程 -> CSS教程 |
→
CSS快速入门 /pc/bin/msg.pl?file_id=k_css target="_blank">///pc/img/message.gif" width="64" height="54" alt="请您留言" border="0">
|
///pc/img/blank.gif" width="1" height="1"> |
|
4、“容器”属性 ※边距属性 听起来是不是很有趣,什么叫“容器”属性呢?CSS的容器属性包括边距、填充距、边框和宽度、高度、浮动、清除等属性。 ///pc/homepage/css/img/css059.gif" width="395" height="113" border="0" alt="容器属性"> 和font属性一样,表中的四个属性可以用一个属性一次。边距顺序是上、右、下、左。我们还是用定义边距属性前后的两个例子来看一下吧。请看下面的这幅图: ///pc/homepage/css/img/css012.gif" width="336" height="289" border="0" alt="未定义边距前的页面"> 我们看到上图是没有加上边距属性的效果,而下图则在<head>中加入了如下代码: body{margin:1em
2em 3em 4em} 产生的效果如下图所示: ///pc/homepage/css/img/css011.gif" width="336" height="289" border="0" alt="加上边距后的页面"> 定义了边距后的页面,无论您怎么改变窗口的大小,它都会按照您定义好的边距样式显示。 如果在margin里有缺失的属性,则按照顺序依次排列。比如: body{margin:1em
3em} 上面这段代码的含义是:body的上、右边距为1、3em。
/pc/bin/msg.pl?file_id=k_css target="_blank">///pc/img/message.gif" width="64" height="54" alt="请您留言" border="0">
|
|