第八章作业

一简答题
1.position属性有哪些属性值?他们在定位元素时,分别有那些特点?
答static:默认值,没有定位
relative:相对定位
absolute:绝对定位
fixed:固定定位
2.z-index属性在网页定位中有什么作用?
答:用于调整元素定位时重叠的上下位置。
3.制作美食今日推荐页面。

index.html

SHOP今日推荐

more

body,div,a,p,ul,li,span,img,h3,h5{
padding: 0px;
margin: 0px;
}
li{
list-style: none;
}
.whole{
width: 280px;
border: 1px #aacbee solid;
height: 400px;
margin: auto;
}
.start{
position: relative;
margin-bottom: 10px;
}
.start h3{
margin-left: 20px;
}
.start span{
color: red;
margin-right: 5px;
}
.start a{
position: absolute;
right: 10px;
top: 5px;
}
.one{
position: relative;
left: 30px;
float: left;
height: 90px;
}
.one #one{
position: relative;
}
.one #two{
position: absolute;
left: 60px;
top: -7px;
z-index: 0;
}
.two{
float: right;
margin-left: 30px;
position: relative;
right: 30px;
height: 90px;
}
.two h5{
margin-bottom: 10px;
}
.two a{
color: red;
font-size: 14px;
}
.two p{
font-size: 12px;
}
.two span{
color: #999999;
}
.three{
float: left;
height: 90px;
margin-left: 30px;
}

4.制作京东轮播图页面。

京东轮播图

body,ul,li{
padding: 0px;
margin: 0px;
}
div{
width: 730px;
height: 454px;
position: absolute;
margin: 100px 240px;
}
li{
width: 20px;
height: 20px;
border: 1px dimgray solid;
border-radius: 10px;
text-align: center;
background-color: dimgray;
float: left;
margin-right: 10px;
list-style: none;
position: relative;
bottom: 30px;
left: 300px;
}
.one{
background-color: #FF6600;
border: 1px #FF6600 solid;
}
a{
color: #FFFFED;
text-decoration: none;
}

5.制作简略版新东方顶部导航菜单页面

新东方顶部导航菜单

body,div,ul,li,a{
margin: 0px;
padding: 0px;
}
li{
list-style: none;
}
a{
text-decoration: none;
}
.whole{
background: url("…/Semester1book3DJ8/top_bg.gif");
width: 620px;
height: 30px;
position: absolute;
}
#one{
margin-left: 10px;
}
.whole li{
margin-left: 10px;
position: relative;
left: 170px;
bottom: 25px;
float: left;
font-size: 14px;
border-right: #999 1px solid;
padding-right: 10px;
}
.whole li:last-of-type{
border: 0px;
}
.whole a{
color: #7b7b7b;
text-decoration: none;
}
#two{
position: relative;
left: 165px;
bottom: 30px;
}
.one{
width: 220px;
height: 230px;
border: 1px #999 solid;
position: absolute;
background: #fff;
left: 370px;
top: 25px;
padding: 5px;
}
.three{
width: 220px;
height: 80px;
border-bottom: 1px #000000 solid;
}
.three a{
font-size: 12px;
color: #999;
margin: 10px;
float: left;
}
.four{
width: 220px;
height: 110px;
border-bottom: 1px #000000 solid;
}
.four a{
font-size: 12px;
color: #999;
margin: 10px;
float: left;
}
.five{
width: 220px;
height: 80px;
}
.five a{
font-size: 12px;
color: #999;
margin: 10px;
float: left;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
第八章作业主要是关于字符串和列表、元组的操作。对于字符串,可以使用索引和切片来获取和修改字符串中的字符,还可以使用内置函数,如len()来获取字符串的长度,以及count()、index()等函数来统计字符出现的次数和找出字符的位置。 对于列表和元组,可以使用索引和切片来获取和修改列表和元组中的元素,还可以使用内置函数,如len()来获取列表和元组的长度,以及count()、index()等函数来统计元素出现的次数和找出元素的位置。 作业可能包括以下内容: 1. 使用字符串的切片和索引操作,截取出指定的子字符串; 2. 使用字符串的内置函数,如count()、index()等来统计指定字符的出现次数和位置; 3. 使用列表的索引来获取和修改指定的元素; 4. 使用列表的切片操作,截取出指定的子列表; 5. 使用列表的内置函数,如append()、count()等来添加元素和统计指定元素的出现次数; 6. 使用元组的索引来获取指定的元素; 7. 使用元组的切片操作,截取出指定的子元组; 8. 使用元组的内置函数,如count()、index()等来统计指定元素的出现次数和位置。 为了完成第八章作业,我们需要熟悉字符串、列表和元组的基本操作和内置函数的使用。可以通过阅读和理解教材中的相关知识点和示例代码,然后按照作业的要求进行编写和测试。编写过程中需要注意细节和语法的正确性,同时也可以参考官方文档和其他相关资料进行查找和学习。完成作业后,可以将代码保存并运行,然后检查输出结果是否符合预期。如果有错误或不清楚的地方,可以再次阅读教材或者寻求帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值