css布局实现自适应响应式博客首页效果代码
代码语言:html
所属分类:响应式
代码描述:css布局实现自适应响应式博客首页效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width">
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="applicable-device" content="pc,mobile">
<meta name="author" content="order by">
<title>折优优</title>
<meta name="keywords" content="" />
<meta name="description" content="折优优 网站定制,wordpress模板" />
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/swiper.min.css">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
<style>
* {
margin: 0;
padding: 0;
font-family: yilong, Helvetica, Arial, "Open Sans", Arial, 'PingFang SC', 'Hiragino Sans GB', 'Source Han Sans CN', Roboto, 'Microsoft Yahei', sans-serif;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-size: 14px;
background: #F6F6F6;
}
a {
color: inherit;
text-decoration: none;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-ms-transition: all .3s ease;
-o-transition: all .3s ease;
transition: all .3s ease
}
a:hover {
color: #00A7EB
}
ul, li, p, h1, h2, h3 {
list-style-type: none;
margin: 0;
padding: 0;
}
h1, h2, h3, h4, h5, h6 {
font-weight: 400;
line-height: 1.4;
color: #273746;
margin: 0;
}
.mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
display: none;
background: #000;
opacity: 0.5;
-webkit-opacity: 0.5;
z-index: 100;
}
@font-face {
font-family: yilong;
font-weight: 400
}
.red {
padding-top:12px;
color: #f54335;
}
@keyframes mymove {
from {
-webkit-transform: rotate(45deg);
transform:rotate(45deg);
}
to {
-webkit-transform: rotate(225deg);
transform: rotate(225deg);
}
}
@-webkit-keyframes mymove {
from {
-webkit-transform: rotate(45deg);
transform:rotate(45deg);
}
to {
-webkit-transform: rotate(225deg);
transform: rotate(225deg);
}
}
@keyframes mymovex {
from {
-webkit-transform: rotate(0deg);
transform:rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-webkit-keyframes mymovex {
from {
-webkit-transform: rotate(0deg);
transform:rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-webkit-keyframes fade-zoom-in {
0% {
opacity:0;
-webkit-transform:scale(1.1);
transform:scale(1.1)
}
100% {
opacity:1;
-webkit-transform:scale(1);
transform:scale(1)
}
}
@-o-keyframes fade-zoom-in {
0% {
opacity:0;
-o-transform:scale(1.1);
transform:scale(1.1)
}
100% {
opacity:1;
-o-transform:scale(1);
transform:scale(1)
}
}
@keyframes fade-zoom-in {
0% {
opacity:0;
-webkit-transform:scale(1.1);
-o-transform:scale(1.1);
transform:scale(1.1)
}
100% {
opacity:1;
-webkit-transform:scale(1);
-o-transform:scale(1);
transform:scale(1)
}
}
.wrap {
max-width: 1200px;
width: 100%;
margin: 0 auto;
padding: 0 15px;
position: relative;
}
.row {
margin-left: -15px;
margin-right: -15px;
}
.backtop {
width: 50px;
height: 50px;
text-align: center;
line-height: 50px;
background: #282828;
opacity: 0.6;
position: fixed;
right: 20px;
bottom: 50px;
cursor: pointer;
}
.backtop i {
color: #fff;
}
.backtop.cd-is-visible {
/* the button becomes visible */
visibility: visible;
opacity: 1;
}
.backtop.cd-fade-out {
/* å¦æç¨æ·ç»§ç»å䏿»å¨,è¿ä¸ªæé®çéæåº¦ä¼å徿´ä½ */
opacity: .5;
}
.no-touch .backtop:hover {
background-color: #e86256;
opacity: 1;
}
.subbody {
padding: 110px 0 0 0;
}
.topmenu {
height: 91px;
background: #fff;
position: fixed;
width: 100%;
z-index: 11;
top: 0;
left: 0;
border-bottom: 1px solid #dedede;
}
.logo {
float: left;
padding: 10px 0;
width: 25%;
}
.logo img {
width: 100px;
height: 36px;
margin-top: 18px;
}
.menu {
float: left;
width: 75%;
}
li.closex {
display: none;
}
.search {
width: 50px;
position: absolute;
right: 0;
top: 35px;
}
.search i {
font-weight: bold;
font-size: 20px;
cursor: pointer;
}
.search-box {
width: 100%;
height: 100%;
background: #fff;
position: fixed;
z-index: 100;
top: 0;
left: 0;
display: none;
font-size: 16px;
-webkit-animation: fade-zoom-in .3s forwards;
-o-animation: fade-zoom-in .3s forwards;
animation: fade-zoom-in .3s forwards;
}
.search-close {
width: 1000px;
height: 60px;
margin: 0 auto;
padding: 100px 0 0 0;
}
.search-close i {
float: right;
font-size: 40px;
color: #666;
cursor: pointer;
}
.search-close i:hover {
animation: mymovex 0.5s 1;
-webkit-animation: mymovex 0.5s 1;
}
dl.se {
overflow: hidden;
}
dl.se dt {
width: 500px;
float: left;
}
dl.se dt input {
width: 100%;
height: 54px;
padding: 0 10px;
border: 1px solid #dedede;
border-radius: 5px;
}
dl.se dd button {
width: 100%;
border: 0;
background: #000;
color: #fff;
height: 56px;
border-radius: 0 5px 5px 0;
}
dl.se dd {
width: 100px;
float: right;
}
.search-con {
width: 600px;
margin: 0 auto;
padding-top: 20px;
}
.search-tips {
line-height: 50px;
padding-top: 30px;
}
.search-as {
line-height: 34px;
}
.search-as a {
padding: 0 20px;
border: 1px solid #dedede;
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
white-space: nowrap;
border-radius: 5px;
color: #ccc;
}
.search-as a:hover {
color: #666;
border: 1px solid #666;
}
/*menu*/
#nav {
width: 800px;
display: block;
margin-top: 25px;
}
#nav .mainlevel {
float: left;
border-right: 1px solid #fff;
position: relative;
z-index: 10;
}
#nav .mainlevel a {
color: #000;
text-decoration: none;
line-height: 40px;
display: block;
padding: 0 20px;
font-size: 17px;
}
#nav .mainlevel a i {
width: 6px;
height: 6px;
border-bottom: 2px solid #666;
border-right: 2px solid #666;
display: block;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
float: right;
margin-top: 16px;
margin-left: 10px;
}
#nav .mainlevel a:hover, #nav .mainlevel a.hover {
color: #19B5FE;
text-decoration: none;
}
#nav .mainlevel a:hover i {
animation: mymove 0.2s 1;
-webkit-animation: mymove 0.2s 1;
transform: rotate(225deg);
margin-top: 19px;
border-bottom: 2px solid #19B5FE;
border-right: 2px solid #19B5FE;
}
#nav .mainlevel ul {
display: none;
position: absolute;
background: #fff;
box-shadow: 1px 3px 5px #888888;
border-top: 0;
}
#nav .mainlevel li {
background: #fff;
color: #19B5FE;
font-size: 15px;
width: 140px;/*IE6 only*/
}
.main {
clear: both;
padding: 120px 0 0px 0;
overflow: hidden;
}
.banner {
width: 66.666666%;
float: left;
padding: 0 15px;
}
.banner-info {
position: absolute;
z-index: 12;
}
.swiper-pagination-bullet {
width: 25px;
height: 3px;
border-radius: 0;
background: #fff;
}
.swiper-slide {
float: left;
width: 100%;
height: 430px;
background-repeat: no-repeat;
background-position: center 0;
background-size: auto 430px;
}
.swiper-button-prev, .swiper-button-next {
display: none;
opacity: 0.6;
width: 36px;
height: 60px;
}
.swiper-button-prev {
background: url(../images/l1.png) no-repeat;
}
.swiper-button-next {
background: url(../images/r1.png) no-repeat;
}
.top-news {
width: 33.333333%;
float: left;
padding: 0 15px;
}
.top-news2 {
width: 100%;
float: left;
margin-bottom: 30px;
}
.top-news-box {
background: #FFF;
-webkit-box-shadow: 0 5px 10px 0 rgba(146,146,146,.1);
-moz-box-shadow: 0 5px 10px 0 rgba(146,146,146,.1);
box-shadow: 0 5px 10px 0 rgba(146,146,146,.1);
}
.top-news h2, .top-news2 h2 {
font-size: 20px;
padding: 0 10px;
font-weight: normal;
line-height: 54px;
border-top: 2px solid #000;
}
.top-img {
padding: 0;
}
.top-img img {
max-width: 100%;
}
ul.topnews li a {
line-height: 39px;
display.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0