教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 资格考试 >

CSS 制作与操作(6)

来源:网络收集 时间:2025-11-14
导读: background: url(images/left-top.gif) top left no-repeat; width:100%; } .rounded h2 { background: url(images/right-top.gif) top right no-repeat; padding:20px 20px 10px; margin:0; } .rounded .main { ba

background: url(images/left-top.gif) top left no-repeat; width:100%; }

.rounded h2 { background: url(images/right-top.gif) top right no-repeat;

padding:20px 20px 10px; margin:0; }

.rounded .main { background: url(images/right.gif) top right repeat-y; padding:10px 20px; margin:-2em 0 0 0;

}

.rounded .footer { background: url(images/left-bottom.gif) bottom left no-repeat; }

.rounded .footer p { color:#888; text-align:right;

background:url(images/right-bottom.gif) bottom right no-repeat; display:block;

padding:10px 20px 20px; margin:-2em 0 0 0; }

#header,#pagefooter,#container{ margin:0 auto; width:760px; }

#container{

position:relative; }

#content{ position:absolute; top:0; left:0; width:500px; }

#content img{ float:right; 图片使用浮动设置,文字会围绕它排列。 }

#side{ margin:0 0 0 500px; }

Page Header

查看详细信息>>

Page Content 2 对于一个网页设计者来说,HTMCSS,并对CSS进行初步的体验。

查看详细信息>>

Side Bar 对于一个网页设计者来说,CSS在这中间扮演着重要的角色。

但是如果希望网页能够美观、间扮演着重要的角色。

查看详细信息>>

Page Footer 这是一行文本,这里作为样例,显示在布局框中。

查看详细信息>>

为了使content能够使用绝对定位 ,必须考虑用哪个元素作为它的定位基准,显然它该是contenter这个div因此。将#container设置为{position:relative; }相对定位 。使它成为下级元素的绝对定位基准。然后将#content{设置为绝对定位。这样它就脱离标准流了。side就会向上移动占据原来content所在的位置。将content的宽度和 side的左 margin设置相同的数值。就保证它们并列紧挨着放置。且不会重叠。但是由于content已经脱离标准流了如果它的高度超过side这个div就会与下面的pagefooter重叠。

2,浮动法

在CSS样式中,稍作修改。将#container的position属性去掉,将#containe和#side都设置为向左浮动。二者的宽度相加等于总宽度。

CSS 制作与操作(6).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/656679.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)