新程序员:一起进步
目录
前言
本项目是基于Html5+CSS3技术所制作的静态网页,适合新手练习学习完成html之后所独立完成的静态网页
一、项目代码
1.头部
效果图:
div盒子模型
HTML代码如下(示例):
CSS代码如下(示例) :
/* 头部 */
.header{
margin-top: 10px;
height: 48px;
}
.header_text{
float: right;
}
.header_text ul li{
background-color: #eafffa;
padding-left: 5px;
float: right;
text-align: center;
width: 60px;
}
.header_text a{
color: #92999a;
width: 100%;
font-size: 10px;
}
/* 设置图片位置
使用相对定位,使图片提升一个层级,相对于原始位置进行定位;
直接定位img无效果原因:img与ul属于同一个层级
向下便宜不会覆盖ul指的是与浏览器的位置 */
.header_text img{
position: relative;
top: 7px;
left: 10px;
}
2.导航栏
效果图:
HTML代码如下(示例):
CSS代码如下(示例):
/* 导航栏 */
.nav{
background-image: url(menuBg.jpg);
height: 36px;
}
.nav ul li{
margin-top: 6px;
text-align: center;
width: 56.47px;
float: left;
}
.nav a{
color: #ffffff;
font-size: 10px;
}
3.banner图
效果图:
HTML代码如下(示例):
CSS代码如下(示例):
/* banner图 */
.banner{
margin-top: 10px;
}
4.主体
div盒子模型:
效果图:
左侧——HTML代码如下(示例):
分类浏览
- 数码影音
- 家居装饰
- 母婴用品
- 美妆个护
- 食品保健
- 潮流服装
- 家具装饰
- 手表饰品
- 鞋包皮具
- 家用电器
- 电脑办公
- 玩具文具
- 汽车用品
- 手机通讯
- 流行饰品
推荐榜单
- 图书畅销榜
- 音乐畅销榜
- 影视畅销榜
- 百货畅销榜
- 图书飙升榜
- 新书热卖榜
左侧——CSS代码如下(示例):
/* 左侧 */
.letft_top,.letft_bottom{
background-color: #fcf9ea;
width: 200px;
border: 2px solid #d8ac52;
}
.left h3{
height: 27px;
background-image: url(navTitleBg.jpg);
padding: 3px 0px 0px 30px;
color: #FBFAF0;
font-size: 12px;
}
.left ul{
padding: 10px;
margin: 10px 0px 0px 30px;
}
.left ul li{
padding-left: 15px;
background-image: url(dot.jpg);
background-repeat: no-repeat;
background-position: 0px center;
/* padding-top: 10px; */
line-height: 26px;
}
.letft_bottom{
margin-top: 10px;
}
右侧——HTML代码如下(示例):
数码影音
-
¥699.00
¥299.00
-
¥499.00
¥199.00~359.00
-
¥499.00
¥299.00
-
¥99.00
¥49.00
-
¥599.00
¥299.00
家居装饰
-
¥568.00
¥299.00
-
¥99.00
¥29.00
-
¥1280.00
¥258.00
-
¥299.00
¥68.00
-
¥398.00
¥198.00
流行饰品
-
¥179.00
¥79.00~89.00
-
¥49.00
¥29.00
-
¥200.00
¥105.00
-
¥299.00
¥156.00
-
¥149.00
¥89.00
右侧——CSS代码如下(示例):
/* 右侧 */
.right{
width: 746px;
padding-left: 10px;
}
.h3_1,.h3_2,.h3_3{
color: #C68B00;
padding-left: 30px;
background-image: url(titleDot.jpg);
background-repeat: no-repeat;
background-position: 0px center;
}
.h3_2,.h3_3{
background-image: url(titleDot.jpg);
background-repeat: no-repeat;
background-position: 0px 233px;
}
.right_middle{
background-position: 100px center;
}
.left,.right{
margin-top: 10px;
float: left;
}
hr{
margin-top: 3px;
background-color: #d59c39;
border: 1px solid #d59c39;
}
.right_top img{
transform: translateY(-20px);
position: relative;
background-size: 20%;
width: 122px;
border: 1px solid #ABABAB;
margin: 0px 0px 0px 24px;
float: left;
}
#ceshi,#ceshi2,#ceshi3,#ceshi4,#ceshi5{
z-index: 2;
top: 30px;
position: relative;
margin-right: 94px;
width: 30px;
border: 0px solid #000000;
}
.right_top ul li{
transform: translate(6px,-18px);
margin-right: -2px;
padding-right : 10px;
font-size: 2px;
width: 141px;
float: left;
}
.right_top a{
color: #3c83d0;
}
.text_2{
text-decoration: line-through;
color: #978D8D;
padding-top: 6px;
}
.text_3{
padding-top: 6px;
color: red;
font-weight: bold;
font-size: 14px;
}
5.底部
效果图:
HTML代码如下(示例):
CSS代码如下(示例):
.footer{
transform: translateY(20px);
}
.footer hr{
border: 1px solid #a8a8a8;
}
.footer ul li{
margin-top: 30px;
transform: translateX(44px);
float: left;
}
.footer img{
transform: translateY(-26px);
}
#right_top_two{
transform: translateY(300px);
}
6.附录
整套资源可自己替换或滴滴我
