1.应用html和css完成如图所示界面效果。内容相对于浏览器居中,图标见附件disc.jpg。
说明:
- 内容相对于浏览器居中,图标见附件disc.jpg
- 盒子边框1px solid #ccc,内边距20px
- 文本字体颜色#122e67,文本高度30px
运行截图
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style >
.div1{margin: 0 auto; width:500px; border:5px solid#ccc;padding: 20px;}
.div2{margin: 0 auto; width:450px; border:1px solid#ccc;padding: 20px;}
li{
text-align: left;
color:#122e67;
line-height: 30px;
text-decoration: solid;
list-style-image: url(images/disc.jpg);
border-bottom: 1px dotted #ccc;
}
</style>
<body>
<div class="div1">
<div class="div2" >
<ul>
<li>222222222222222222222222222222222222</li>
<li>222222222222222222222222222222222222</li>
<li>222222222222222222222222222222222222</li>
<li>222222222222222222222222222222222222</li>
<li>222222222222222222222222222222222222</li>
<li>222222222222222222222222222222222222</li>
</ul>
</div>
</div>
</body>
</html>
2.完成如下图所示界面设计效果
说明:
- 可考虑基于列表进行设计,居中显示
- 将列表转换为inline-block实现横向显示,每项高200px 宽216px,上、左内间距20px
- 上部字体大小18px,颜色#000,下部字体大小14px,颜色#64C333
- 所需图片见附件,图片宽度154px,左间距60px
运行截图:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
.box{
width: 1200px;
margin: auto;
background-color: #ccc;
}
.box ul{
margin: auto;
}
img{
width: 154px;
padding-left: 60px;
}
li{
display: inline-block;
overflow: hidden;
background-color: white;
border-top:4px solid #ccc;
height: 200px;
width: 216px;
padding-left: 20px;
padding-top: 20px;
}
.span1{
display: block;
font-size: 18px;
color: #000;
}
.span2{
display: block;
font-size: 14px;
color: #64C333;
}
</style>
<body>
<div class="box">
<ul>
<li>
<span class="span1">
抱抱果新首发
</span>
<span class="span2">
抱一下就幸福
</span>
<img src="images/1.jpg">
</li>
<li>
<span class="span1">
天猫冰箱节
</span>
<span class="span2">
智由随风
</span>
<img src="images/2.jpg">
</li>
<li>
<span class="span1">
西门子全球精选
</span>
<span class="span2">
旗舰精品享你所想
</span>
<img src="images/3.jpg">
</li>
<li>
<span class="span1">
进口葡萄酒专场
</span>
<span class="span2">
原瓶进口品质保证
</span>
<img src="images/4.jpg">
</li>
<li>
<span class="span1">
手机专场
</span>
<span class="span2">
原装正品
</span>
<img src="images/5.jpg">
</li>
</ul>
</div>
</body>
</html>
三、完成下图所示的静态网页制作
说明:
- 可考虑基于列表进行设计,居中显示
- 列表项高320px 宽250px,外间距10px,内间距10px,边框线1px solid #ccc
- 每项中第一行文字14px,颜色#666,文本行高度32px。其他行文字12px,颜色#66667F,文本行高度25px
- “原创作品”加粗,颜色#FF5584
- 所需图片见附件,图片宽度250px,高度188px
运行截图:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
div{
margin-left: 50%;
margin: 0 auto;
}
li{
height: 320px;
width: 250px;
margin: 10px;
padding: 10px;
border: 1px solid #ccc;
overflow: hidden;
}
.h1{
line-height: 20px;
font-size: 14px;
color: #666;
font-weight: bold;
}
.h2{
line-height: 15px;
font-size: 12px;
color: #66667F;
}
strong{
color: #FF5584;
}
</style>
<body>
<div>
<ul>
<li>
<img src="images/pic1.jpg" width=250px height=188px>
<span class="h1">动画便利店X果壳网《西门子洗碗机...</span>
<p class="h2"><strong> 原创作品</strong>-影视-Motion Graphic</p>
<p class="h2">
2小时前上传
</p>
<p class="h2">
<strong>1284 </strong> 人气/<strong>11 </strong> 评论/<strong>47 </strong>推荐
</p>
<img src="images/play.png">
</li>
<li>
<img src="images/pic2.gif" width=250px height=188px>
<span class="h1">动画便利店X视知《到底工资怎么发...</span>
<p class="h2"><strong> 原创作品</strong>-影视-Motion Graphic</p>
<p class="h2">
3小时前上传
</p>
<p class="h2">
<strong>1569 </strong> 人气/<strong>50 </strong> 评论/<strong>125 </strong>推荐
</p>
<img src="images/play.png">
</li>
</ul>
</div>
</body>
</html>
- 应用html标签和css完成如下所示页面效果,图片见附件。
说明:
- 内容相对于浏览器居中,宽860px
- 鼠标移动至列表项上,显示背景色#F8F8F8
- 分割线2px solid #ccc,每项高130px
- 第一行文字:20px 黑体
- 标签:字颜色#cccc00 16px
- 标签项:背景颜色#eee 字体颜色#999 文字大小14px
- 第三行文字:边框1px solid #eee; 圆角半径25px
其他样式可根据界面效果进行设置
运行截图
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style type="text/css">
ul{
margin:auto;
}
div{
display: flex;
}
img{
height: 100px;
margin-top: 15px;
margin-left: 10px;
}
li{
overflow: hidden;
border-top: 2px solid #ccc;
width: 860px;
height: 130px;
}
li:hover{
background-color: #f8f8f8;
}
.p1{
display: block;
margin-left: 20px;
}
.p2{
font:20px 黑体;
margin-left: 20px;
margin-top: 15px;
}
.p3{
border: 1px solid #eee;
border-radius: 25px;
font-size: 14px;
margin-left: 20px;
}
.tag{
font-size: 16px;
color: #cccc00;
}
.tag2{
display:inline-block;
background-color: #eee;
font-size: 14px;
color: #999;
margin:3px;
text-align: center;
}
span{
color: #999;
font-size: 14px;
}
</style>
<body>
<ul >
<li>
<div>
<img src="images/4.jpg">
<div class="p1">
<p class="p2">
不只有看肤色挑唇色 选对口红衣服更美
</p>
<p class="p1">
<span class="tag">标签</span>
<span class="tag2">唇膏</span>
<span class="tag2">衣服</span>
<span class="tag2">粉色</span>
<span class="tag2">化妆</span>
<span class="tag2">美容美体</span>
</p>
<span class="p3">悦己self</span>
<span>2016-10-18</span>
</div>
</div>
</li>
<li>
<div>
<img src="images/5.jpg">
<div class="p1">
<p class="p2">
学画红唇妆 让你的女王范分分钟秒杀录人
</p>
<p class="p1">
<span class="tag">标签</span>
<span class="tag2">唇膏</span>
<span class="tag2">衣服</span>
<span class="tag2">粉色</span>
<span class="tag2">化妆</span>
<span class="tag2">美容美体</span>
</p>
<span class="p3">毛戈平形象艺术学校</span>
<span>2016-10-18</span>
</div>
</div>
</li>
<li>
<div>
<img src="images/6.jpg">
<div class="p1">
<p class="p2">
不只有看肤色挑唇色,选对口红衣服更美
</p>
<p class="p1">
<span class="tag">标签</span>
<span class="tag2">美容美体</span>
</p>
<span class="p3">八公举</span>
<span>2016-10-18</span>
</div>
</div>
</li>
</ul>
</body>
</html>
2.完成如图所示界面布局和显示效果
运行截图:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body{
width: 90%;
margin:auto;
position:fixed;
}
.title{
border: 8px solid;
border-radius: 3px;
margin-top: 10px;
border-color: grey;
background-color: grey;
}
span{
text-decoration: underline;
margin-left: 40px;
font-size: 16px;
color: white;
}
span:hover{
color: red;
}
p{
margin-left: 15px;
font:20px 黑体;
}
li{
overflow: hidden;
margin-top: 20px;
margin-bottom: 20px;
font:12px 黑体;
}
.bankuai1{
width: 320px;
height: 200px;
float: left;
display:inline-block;
margin-right: 100px;
margin-top: 30px;
}
.news{
margin-right: 10px;
}
.date{
float:right;
}
.end{
text-decoration: underline;
font: 16px 黑体;
}
.mokuai2{
margin-top: 500px;
position: fixed;
width: 80%;
text-align: center;
}
</style>
<body>
<div class="title">
<span>首页</span>
<span>新闻</span>
<span>体育</span>
<span>娱乐</span>
<span>财经</span>
<span>科技</span>
<span>手机</span>
<span>数码</span>
</div>
<div class="bankuai1">
<p>娱乐新闻</p>
<ul>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
</ul>
</div>
<div class="bankuai1">
<p>军事新闻</p>
<ul>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
</ul>
</div>
<div class="bankuai1">
<p>数码新闻</p>
<ul>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">IDF2018英特尔谷歌联手</a><a class="date">2018-10-1</a>
</li>
</ul>
</div>
<div class="bankuai1">
<p>手机新闻</p>
<ul>
<li>
<a class="news">超大运行内存手机推荐</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">国产旗舰手机盘点</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">西门子归来 首款智能机配置强跑分出色</a><a class="date">2018-10-1</a>
</li>
<li>
<a class="news">11111111111111111111</a><a class="date">2018-10-1</a>
</li>
</ul>
</div>
<div class="mokuai2">
<a class="end">关于我们</a><a> </a><a class="end">联系我们</a>
</div>
</body>
</html>
3.完成如下表单界面设计,图片见附件。
- 表单宽248px,高220px,背景色#F5EAE8,上下内边距30px 左右内边距40px,边框1px solid #F5EAE8
- 输入框宽250px,高38px,边框1px solid #CCC,下外边距30px。文本缩进50px,便于显示前方图标。前方图标可考虑背景图片进行设置。
- 按钮宽255px,高44px,外边距上下25px,左右居中
- 合作网站区域宽330px 高145px,背景颜色#F5EAE8,上边框1px solid #ddd
- 内容居中显示
运行截图
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body{
margin:0 auto;
width:300px;
height:200px;
margin-top: 100px;
}
.table{
width: 248px;
height:220px;
padding-top: 30px;
padding-bottom: 30px;
background-color: #F5EAE8;
padding-left: 40px;
padding-right: 40px;
border:1px solid #F5EAE8;
}
.input1{
background-color: #F5EAE8;
width: 250px;
height: 38px;
border: 1px solid #ccc;
margin-bottom: 30px;
color: #ccc;
font-size: 15px;
background-image: url("images/zhanghao.jpg");
background-repeat: no-repeat;
text-indent:50px;
background-position: left;
}
.input2{
background-color: #F5EAE8;
width: 250px;
height: 38px;
border: 1px solid #ccc;
margin-bottom: 30px;
color: #ccc;
font-size: 15px;
background-image: url("images/mima.jpg");
background-repeat: no-repeat;
text-indent:50px;
background-position: left;
}
.website{
height:145px;
width:330px;
background-color: #F5EAE8;
border-top: 1px solid #ddd;
text-align: center;
padding-top: 10px;
}
.div1{
display: inline-block;
}
span{
font-size: 12px;
color:darkgrey;
}
label{
font-size: 15px;
}
.img1{
width: 255px;
height: 44px;
margin-top: 25px;
margin-bottom: 25px;
text-align: center;
}
</style>
<body>
<div class="table">
<input class="input1" placeholder="用户名/邮箱地址/手机号" style="position:static;" >
<input class="input2" placeholder="填写密码" style="position:static;" >
<div class="div_e">
<input type="checkbox" ><label>记住密码</label>
<span>欢迎注册</span>
<span>忘记密码</span>
</div>
<div>
<img class="img1" src="images/but.jpg">
</div>
</div>
<div class="website">
<div class="div1">
<a>合作账号登录:</a>
<img src="images/weixin.png">
<img src="images/qqlogin.png">
<img src="images/taobao.png">
</div>
</div>
</body>
</html>