dd效果图如下
huml 源码
小米商城
主页模块源码
.main {
float: left;
width: 990px;
height: 460px;
background-color: pink;
margin-left: 210px;
}
.focus ul li img {
width: 992px;
height: 461px;
}
.focus {
position: relative;
}
.prev,
.next {
/* 加了绝对定位的盒子可以直接设置宽度和高度 */
position: absolute;
top: 0;
/* 盒子垂直居中的算法 */
top: 50%;
margin-top: -34px;
width: 40px;
height: 68px;
background: rgba(255, 250, 250, 0.4);
text-align: center;
line-height: 68px;
font-size: 40px;
color: #BEBEBE;
}
.prev {
left: 0;
}
.next {
right: 0;
}
.prev:hover {
background: rgba(0, 0, 0, .5);
color: #fff;
}
.next:hover {
background: rgba(0, 0, 0, .5);
color: #fff;
}
.dot {
position: absolute;
bottom: 6px;
right: 22px;
background-color: rgba(0, 0, 0, 0.0);
width: 60px;
height: 30px;
}
.dot li {
width: 10px;
height: 10px;
background-color: #4c5a56;
float: left;
border-radius: 50%;
margin: 2px 4px;
}
.dot li:hover {
background-color: #fff;
}
.row1 {
/* float: right; */
margin-top: 13px;
height: 172px;
background-color: #fff;
}
.row1 div {
float: left;
}
.two {
margin-left: 10px;
}
.three {
margin-left: 10px;
}
.forth {
margin-left: 10px;
}
.row2 {
margin-top: 50px;
}
.row3 {
height: 35px;
margin-top: 35px;
margin-bottom: 16px;
}
.shouji .left {
line-height: 35px;
float: left;
font-size: 22px;
font-weight: 100px;
}
.shouji .right {
line-height: 35px;
float: right;
}
/* .row2,
.row3,
.row4 {
background-color: #f5f5f5;
} */
.row4 .left {
float: left;
}
/* .row::after {
content: "";
display: block; */
/* height: 0; */
/* clear: both;
visibility: hidden;
} */
.right::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.left::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.right ul li {
float: right;
}
.right .h {
position: absolute;
top: 300px;
left: 965px;
}
.right {
position: relative;
}
.row5 .zhineng {
height: 25px;
float: left;
font-size: 25px;
font-weight: 100px;
}
.row5 .chuandai {
float: right;
margin-top: 5px;
}
.row5::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row5 {
margin-top: 35px;
margin-bottom: 20px;
}
.row5 .chuandai:hover {
height: 38px;
height: 25px;
display: block;
text-decoration: solid;
}
.bijiben {
float: left;
font-size: 25px;
}
.remen {
float: right;
}
.row7 {
margin-top: 15px;
margin-bottom: 15px;
}
.row7::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row8 .left8 {
float: left;
}
.row8 .right8 ul li {
float: right;
margin-left: 3px;
}
.right8::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.left8::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.bi9 {
position: absolute;
left: 965px;
top: 300px;
}
.bi8 {
position: absolute;
left: 730px;
top: 300px;
}
.right8 ul {
position: relative;
}
.row9 {
margin-top: 10px;
margin-bottom: 15px;
}
.row9 .jiadian {
float: left;
font-size: 25px;
}
.row9 .yingyin {
float: right;
margin-top: 7px;
}
.row9::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row10 li {
float: left;
}
.row10::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row10 .xiyiji {
position: absolute;
top: 300px;
left: 0;
}
.row10 {
position: relative;
}
.row11 {
margin-top: 15px;
margin-bottom: 15px;
}
.row11 .dianqi {
float: left;
font-size: 25px;
}
.row11 .saodiji {
float: right;
margin-top: 7px;
}
.row11::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row12 {
margin-bottom: 10px;
}
.row12 li {
float: left;
}
.row12::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row13 li {
float: left;
}
.row13::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row13 {
margin-bottom: 20px;
}
.row14 {
margin-bottom: 20px;
}
.row15 .baihuo {
float: left;
font-size: 25px;
}
.row15 .jiankang {
margin-top: 10px;
float: right;
}
.row15::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row15 {
margin-bottom: 15px;
}
.row16 li {
float: left;
}
.row17 li {
float: left;
}
.row16::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row17::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.shipin {
float: left;
font-size: 25px;
}
.all {
margin-top: 10px;
float: right;
}
.row18 {
margin-top: 15px;
margin-bottom: 15px;
}
.row18::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
.row19 li {
float: left;
}
.bb,
.cc,
.dd {
margin-left: 5px;
}
.row19::after {
content: "";
display: block;
/* height: 0; */
clear: both;
visibility: hidden;
}
初始样式代码
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
em,
i {
font-style: normal;
}
li {
list-style: none;
}
img {
border: 0;
vertical-align: middle;
}
button {
cursor: pointer;
}
a {
color: #666;
text-decoration: none;
}
a:hover {
color: #ff6700;
}
button,
input {
font-family: Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53";
border: 0;
outline: none;
}
boody {
font-family: Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53";
background-color: skyblue;
color: #666;
}
.head,
.none {
display: none;
}
.clearfix:after {
visibility: hidden;
clear: both;
display: block;
content: ".";
height: 0;
}
.clearfix {
*zoom: 1;
}
顶端和底部代码
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?yqmruw');
src: url('fonts/icomoon.eot?yqmruw#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?yqmruw') format('truetype'), url('fonts/icomoon.woff?yqmruw') format('woff'), url('fonts/icomoon.svg?yqmruw#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
/* 版心宽度 */
.w {
/* 1540px */
width: 1200px;
margin: 0 auto;
}
/* 导航模块 */
.shortcut {
height: 40px;
line-height: 40px;
background-color: #333333;
}
.fl {
float: left;
}
.fr {
float: right;
position: relative;
}
.shortcut ul li {
float: left;
}
.shortcut ul li a {
color: #c3c3c3;
font-size: 12px;
}
.shortcut ul li a:hover {
color: #ffffff;
}
.shopping {
display: block;
height: 40px;
width: 100px;
background-color: #424242;
text-align: center;
}
.shopping:hover {
background-color: #ffffff;
/* 这个字体颜色为什么不能改变 */
color: #ff6700;
}
.shopcar {
width: 100px;
height: 48px;
background-color: #585050;
/* position: absolute;
right: 0; */
float: right;
line-height: 44px;
text-align: center;
color: #fff;
font-size: 12px;
}
.fr ul .shopcar:hover {
background-color: #fff;
color: #ff6700;
}
.shopcar::before {
content: '\e93a';
font-family: 'icomoon';
}
/* .shopcar::after {
content: '2';
} */
/* 导航模块结束 */
/* 头部模块开始 */
.header {
position: relative;
height: 125px;
background-color: #fff;
}
.logo {
position: absolute;
top: 25px;
height: 87px;
width: 73px;
background-color: #ffffff;
}
.logo a {
display: block;
height: 87px;
width: 73px;
background: url(../logo2.png) no-repeat;
font-size: 0;
}
/* 热词导航模块 */
.headercut {
position: absolute;
top: 43px;
left: 200px;
}
.headercut a {
margin: 0 5px;
}
.search {
position: absolute;
left: 830px;
top: 30px;
width: 340px;
height: 53px;
border: 2px solid #e0e0e0
}
.search input {
float: left;
width: 300px;
height: 50px;
padding-left: 10px;
border-right: 1px solid #e0e0e0
}
/*
inout和button都属于行内块元素,中间默认会有缝隙,消除缝隙需要给他们加浮动 */
.search button {
float: left;
width: 36px;
height: 50px;
}
.search button img {
width: 100%;
height: 100%;
}
.search :hover {
border: 1px solid #ff6700;
}
/* 商品分类模块 */
.fenlei {
/* display: none; */
float: left;
width: 210px;
height: 460px;
background-color: #9e9696;
position: absolute;
top: 0;
left: 0;
}
.fenlei :after {
content: ".";
clear: both;
display: block;
height: 0;
overflow: hidden;
visibility: hidden;
}
.middle {
height: 460px;
/* display: inline-block; */
position: relative;
}
.fenlei li {
position: relative;
height: 40px;
line-height: 40px;
padding-left: 30px;
/* margin-top: 20px; */
}
.fenlei .first {
margin-top: 25px;
}
.fenlei ul li a {
font-size: 14px;
color: #fff;
}
.fenlei li:hover {
background-color: #ff6700;
}
.fenlei ul li::after {
content: '>';
position: absolute;
top: 1px;
right: 20px;
font-size: 18px;
color: #fff;
}
/* 底部模块 */
.footer {
height: 450px;
background-color: #fff;
padding-top: 30px;
}
.mod_serice {
height: 60px;
border-bottom: 1px solid #ccc;
}
.mod_serice ul li {
float: left;
width: 240px;
height: 30px;
background-color: #fff;
/* padding-left: 35px; */
margin-top: 15x;
border-right: 1px solid #ccc;
}
/* 清除浮动 */
.mod_serice ul li:after {
content: ".";
clear: both;
display: block;
height: 0;
overflow: hidden;
visibility: hidden;
}
.mod_serice ul .e {
border: 0;
}
.mod_serice ul li {
line-height: 30px;
text-align: center;
}
/* 文字图标显示不了 */
/* .mod_serice ul .a::before {
content: 'e991';
font-family: 'icomoon';
}
.mod_serice ul .b::before {
content: '';
content: 'e984';
font-family: 'icomoon';
}
.mod_serice ul .c::before {
content: 'e981';
font-family: 'icomoon';
}
.mod_serice ul .d::before {
content: 'e99f';
font-family: 'icomoon';
}
.mod_serice ul .a::before {
content: 'e948';
font-family: 'icomoon';
} */
/* 底部帮助模块 */
.mod_help {
height: 350px;
background-color: #fff;
padding-top: 30px;
padding-left: 130px;
/* margin-top: 30px; */
}
.mod_help dl dt {
font-size: 16px;
margin-bottom: 15px;
margin-top: 30px;
}
.mod_help dl {
float: left;
width: 166px;
}
.mod_help dl dd {
font-size: 12px;
margin-bottom: 9px;
}
.mod_tell {
width: 234px;
height: 100px;
background-color: #fff;
float: right;
border-left: 1px solid black;
margin-top: 30px;
}
.mod_tell :after {
content: ".";
clear: both;
display: block;
height: 0;
overflow: hidden;
visibility: hidden;
}
.mod_tell {
text-align: center;
}
.mod_help h5 {
font-size: 22px;
color: #ff6700;
}
.mod_help p {
margin-top: 5px;
display: inline-block;
font-size: 12px;
color: #616161;
}
.mod_help h6 {
display: inline-block;
width: 100px;
height: 30px;
border: 1px solid #ff6700;
margin-top: 8px;
line-height: 30px;
color: #ff6700;
font-size: 13px;
}
.links a {
font-size: 13px;
margin: 0 3px;
}
.links {
font-size: 12px;
margin-bottom: 15px;
}
.copyright {
line-height: 20px;
font-size: 12px;
color: #b0b0b0;
}
/* .logo_1 {
position: absolute;
top: 30px;
left: 10px;
height: 87px;
width: 73px;
background: url(../logo2.png) no-repeat;
} */
.mod_copyright {
margin-top: 40px;
/* width: 1920px; */
text-align: center;
float: left;
/* width: 1800px; */
/* margin: 0 auto; */
height: 240px;
/* background-color: #fafafa; */
/* text-align: center; */
/* padding-top: 20px;
position: relative; */
}
.logo1 {
float: left;
/* position: absolute; */
margin-top: 20px;
margin-left: 340px;
top: 150px;
left: 500px;
height: 35px;
width: 550px;
background: url(../logo_bottom.png) no-repeat;
}