任务描述
本关任务:用overflow属性实现移动端电商界面。
相关知识
为了完成本关任务,你需要掌握:
1.盒模型
2.overflow属性
选择器{overflow:属性值;}
,
编程要求
根据提示,在右侧编辑器补充
设置all盒模型中的宽度为346px,高度为578px;
设置all盒模型中的上下外边距为 20px ,左右自动(auto),居中显示;
设置all盒模型中的内边距分别为90px 0 0 34px;
设置content盒模型的宽度为277px,高度为414px;
设置content盒模型的溢出内容会被修剪,且浏览器会始终显示滚动条的属性值代码。
显示效果图如下:
,
测试说明
补充代码后,请点击测评,平台会对你编写的代码进行测试,如果正确则完成闯关任务。
越努力越幸运,祝你成功!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>移动电商页面</title>
<style type="text/css">
/* ********* Begin ********* */
body{ font-size:12px;}
body,img{padding:0; margin:0; border:0;}
.all{
width:346px;
height:578px;
background:url(https://www.educoder.net/api/attachments/2073417) no-repeat;
margin:20px auto;
padding:90px 0 0 34px;
}
.content{
width:277px;
height:414px;
overflow: scroll;
/* ********* End ********* */
}
</style>
</head>
<body>
<div class="all">
<div class="content">
<img src="https://www.educoder.net/api/attachments/2072741" />
</div>
</div>
</body>
</html>