css
/* 样式书写 */
/* 页头部分 */
/* 页头最上部分 */
.page {
/* 限制最小宽度为1152像素 */
min-width: 1152px;
height: 150px;
}
.page .page-upward {
min-width: 1152px;
height: 32px;
background-color: #2A2A2A;
}
/* 左上部分导航条 */
.page .page-upward .left-on ul li {
float: left;
margin-right: 18px;
}
.page .page-upward .left-on .have-menu {
position: relative;
}
/* 三个盒子压盖制作小方向标 */
.page .page-upward .left-on .arrow {
position: absolute;
width: 12px;
height: 12px;
top: 50%;
right: -2px;
margin-top: -6px;
transition: transform .2s linear 0s;
}
.page .page-upward .left-on .arrow:hover {
transform: rotate(180deg);
}
.page .page-upward .left-on .arrow b {
position: absolute;
width: 5px;
height: 5px;
top: 3px;
left: 4px;
background-color: white;
transform: rotate(45deg);
}
.page .page-upward .left-on .arrow i {
position: absolute;
width: 5px;
height: 5px;
top: 1px;
left: 4px;
background-color: #2A2A2A;
transform: rotate(45deg);
}
.page .page-upward .left-on ul li:nth-child(3),
.page .page-upward .left-on ul li:nth-child(5),
.page .page-upward .left-on ul li:nth-child(6) {
padding-right: 12px;
}
.page .page-upward .left-on a {
line-height: 32px;
font-size: 13px;
color: #FFFFFF;
}
/* 右上部分导航条 */
.page .page-upward .right-on a,
.page .page-upward .right-on span {
float: right;
font-size: 16px;
color: #FFFFFF;
line-height: 32px;
margin-right: 16px;
}
/* 页头中间部分 */
.page .page-middle {
min-width: 1152px;
height: 40px;
background-color: #20BD9A;
}
.page .page-middle li {
float: left;
margin-right: 18px;
}
.page .page-middle li.ylj {
padding-right: 18px;
position: relative;
}
/* 用三角形特性制作小按钮 */
.page .page-middle .yj {
position: absolute;
width: 0px;
height: 0px;
top: 19px;
right: 4px;
border: 4px solid transparent;
/* 去掉下边框 打破正方形 方便旋转 */
border-bottom: none;
border-top-color: white;
transition: transform .2s linear 0s;
}
.page .page-middle .yj:hover {
transform: rotate(180deg);
}
.page .page-middle a {
font-size: 16px;
color: #FFFFFF;
line-height: 40px;
}
/* 页头最下部分 */
.page .page-down {
height: 34px;
padding: 21px 0;
}
/* 主标题部分 */
.page .page-down h1 {
float: left;
font-size: 24px;
font-weight: bold;
color: #20BD9A;
line-height: 34px;
margin-right: 20px;
}
/* 文本框部分 */
.page .page-down .soso-box {
float: left;
width: 405px;
padding-top: 3px;
}
.page .page-down input {
float: left;
width: 371px;
height: 28px;
border: 1px solid #20BD9A;
border-radius: 3px 0 0 3px;
/* 取消默认的外线(外线是文本框特有的东西) */
outline: none;
}
.page .page-down .btn {
float: left;
display: block;
width: 32px;
height: 30px;
text-align: center;
line-height: 30px;
background: #20BD9A;
color: #FFFFFF;
border-radius: 0 4px 4px 0;
right: 1px;
bottom: 2px;
}
/* banner */
/* 大轮播图 */
.banner {
position: relative;
}
.banner img {
width: 100%;
/* mian-width属性限制页面的最小宽度 */
min-width: 1152px;
/* 图片可能和盒子底部产生缝隙 用这个属性去掉缝隙 */
vertical-align: middle;
}
/* 左边热门出发地 */
.banner .center-wrap {
position: absolute;
width: 1152px;
/* 100%高度要设置 不能让高度是0 后面还有子盒子 */
height: 100%;
top: 0;
left: 50%;
margin-left: -576px;
}
.banner .center-wrap .banner-nav {
height: 100%;
}
.banner .center-wrap .banner-nav ul {
/* 这里的高度同样不能省略 */
height: 100%;
}
.banner .center-wrap .banner-nav li {
height: 16.66%;
width: 296px;
background-color: rgba(0, 0, 0, 0.574);
border-bottom: 1px solid rgba(255, 255, 255, 0.401);
box-sizing: border-box;
}
.banner .center-wrap .leftbtn {
position: absolute;
width: 28px;
height: 44px;
background: url(../images/icons.png) no-repeat -21px -94px;
top: 50%;
left: -38px;
margin-top: -22px;
}
.banner .center-wrap .leftbtn:hover,
.banner .center-wrap .rightbtn:hover {
opacity: 0.8;
}
.banner .center-wrap .rightbtn {
position: absolute;
width: 28px;
height: 44px;
background: url(../images/icons.png) no-repeat -21px -29px;
top: 50%;
right: -38px;
margin-top: -22px;
}
.banner .center-wrap .banner-nav>ul>li {
position: relative;
}
.banner .center-wrap .banner-nav>ul>li dl {
position: absolute;
height: 48px;
left: 42px;
top: 50%;
margin-top: -24px;
color: white;
}
.banner .center-wrap .banner-nav>ul>li dl dt {
font-size: 18px;
height: 26px;
line-height: 26px;
}
.banner .center-wrap .banner-nav>ul>li dl dd {
font-size: 16px;
height: 22px;
line-height: 22px;
}
/* 小图标共性 */
.banner .center-wrap .banner-nav>ul>li::before {
content: '';
position: absolute;
background-image: url(../images/icons.png);
top: 50%;
left: 10px;
}
/* 个性 小属性层叠大属性 */
.banner .center-wrap .banner-nav>ul>li.hot::before {
width: 22px;
height: 18px;
background-position: -29px -399px;
margin-top: -9px;
}
.banner .center-wrap .banner-nav>ul>li.hk::before {
width: 18px;
height: 21px;
background-position: -28px -217px;
margin-top: -10px;
}
.banner .center-wrap .banner-nav>ul>li.jp::before {
width: 24px;
height: 19px;
background-position: -25px -171px;
margin-top: -9.5px;
left: 9px;
}
.banner .center-wrap .banner-nav>ul>li.as::before {
width: 18px;
height: 19px;
background-position: -28px -262px;
margin-top: -9.5px;
}
.banner .center-wrap .banner-nav>ul>li.eu::before {
width: 20px;
height: 14px;
background-position: -29px -351px;
margin-top: -7px;
}
.banner .center-wrap .banner-nav>ul>li.au::before {
width: 18px;
height: 17px;
background-position: -28px -305px;
margin-top: -8.5px;
}
.banner .center-wrap .banner-nav .menus-box .menu {
/* 让所有menu隐藏 */
display: none;
position: absolute;
left: 296px;
top: 0;
width: 356px;
height: 100%;
background-color: rgba(0, 0, 0, 0.63);
color: #FFFFFF;
padding: 16px;
box-sizing: border-box;
}
/* 加上current类名可用于显示文字 (display: block;) */
.banner .center-wrap .banner-nav .menus-box .menu.current {
display: block;
}
.banner .center-wrap .banner-nav .menus-box .menu a {
color: #FFFFFF;
}
.banner .center-wrap .banner-nav .menus-box .menu dl {
margin-bottom: 16px;
}
.banner .center-wrap .banner-nav .menus-box .menu dl dt {
line-height: 30px;
font-size: 18px;
}
.banner .center-wrap .banner-nav .menus-box .menu dl dd {
line-height: 25px;
font-size: 15px
}
/* 热门广告 */
.hot-ads {
margin-top: 32px;
margin-bottom: 32px;
}
.hot-ads ul li {
float: left;
width: 264px;
height: 110px;
margin-right: 32px;
}
.hot-ads ul li:last-child {
margin-right: 0;
}
/* 新鲜甩尾 */
.xxsw {
height: 698px;
background-color: #F7F7F7;
margin-top: 40px;
}
.xxsw .hd {
margin-bottom: 32px;
}
/* 共性 .content-part */
.content-part .hd h2 {
font-size: 36px;
color: #1C1F21;
font-weight: bold;
}
/* 个性 */
.xxsw .hd h2 {
float: left;
margin: 40px 12px 0 0;
}
.xxsw .hd em {
float: left;
font-size: 12px;
color: #1C1F21;
position: relative;
top: 65px;
left: 10px;
}
.xxsw ul li {
float: left;
width: 264px;
height: 270px;
margin-bottom: 32px;
margin-right: 32px;
background-color: #FFFFFF;
}
.xxsw ul li:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.20);
}
.xxsw ul li:nth-child(4n) {
margin-right: 0;
}
.xxsw ul li .wordbox {
padding: 15px;
font-size: 14px;
color: #1C1F21;
}
/* 机酒自由行 */
.common-style {
height: 698px;
background-color: #FFFFFF;
padding-top: 40px;
}
.common-style .hd h2 {
float: left;
margin-right: 12px;
}
.common-style .hd em {
float: left;
position: relative;
top: 29px;
font-size: 12px;
color: #000000;
}
/* 为了样式复用 换公共类content-part */
.content-part .hd nav {
float: right;
width: 532px;
position: relative;
top: 20px;
}
.content-part .hd nav ul li {
float: left;
margin-right: 14px;
}
.content-part .hd nav ul li:last-child {
margin-right: 0;
}
.content-part .hd nav ul li a {
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
}
.content-part .hd nav ul li.current {
border-bottom: 4px solid #20BD9A;
padding-bottom: 2px;
}
.content-part .hd nav ul li.current a {
color: #20BD9A;
}
/* 公共的一个特效 属性触碰图片 有放大效果 */
.content-part img {
transition: transform .4s ease 0s;
}
.content-part img:hover {
transform: scale(1.1);
}
/* 溢出隐藏 */
.content-part li {
overflow: hidden;
}
.content-part li .picbox {
height: 184px;
overflow: hidden;
}
.content-part .grid {
overflow: hidden;
}
/* 图片部分 */
.common-style .bd {
padding-top: 32px;
}
.common-style .bd>ul>li {
float: left;
margin-right: 32px;
margin-bottom: 32px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.08);
background-color: white;
}
.common-style .bd>ul>li:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.20);
}
.common-style .bd>ul>li:nth-child(3),
.common-style .bd>ul>li:nth-child(7) {
margin-right: 0;
}
.common-style .bd>ul>li.biggrid {
width: 560px;
height: 270px;
position: relative;
}
.common-style .bd>ul>li .tag {
position: absolute;
width: 74px;
height: 40px;
color: #FFFFFF;
background-color: rgba(0, 0, 0, .53);
bottom: 104px;
left: 0;
text-align: center;
line-height: 40px;
/* 图片触碰产生transform变形 此时会盖住tag 我们需要书写z-index属性来反盖 */
z-index: 9999;
}
.common-style .bd>ul>li.biggrid .info {
position: absolute;
width: 560px;
height: 103px;
color: #FFFFFF;
padding: 30px 26px;
font-size: 14px;
line-height: 22px;
box-sizing: border-box;
background-color: rgba(0, 0, 0, .53);
bottom: 0;
left: 0;
}
.common-style .bd>ul>li.progrid {
width: 264px;
height: 270px;
}
.common-style .bd>ul>li.progrid .picbox {
position: absolute;
height: 184px;
}
.common-style .bd>ul>li.progrid .picbox .tag {
bottom: 0;
}
.common-style .bd>ul>li.progrid .wordbox {
font-size: 14px;
color: #1C1F21;
line-height: 22px;
padding: 20px 14px 22px 14px;
}
/* 为了样式复用 换公共类.content-part */
.content-part .moregrid {
width: 264px;
height: 270px;
background-image: linear-gradient(180deg, #34E3BC 0%, #15AF7A 98%);
box-sizing: border-box;
position: relative;
}
.content-part .moregrid a {
display: block;
padding-top: 46px;
height: 270px;
box-sizing: border-box;
}
.content-part .moregrid p {
text-align: center;
color: #FFFFFF;
line-height: 24px;
font-size: 14px;
}
.content-part .moregrid .iconfont {
position: absolute;
font-size: 48px;
width: 48px;
height: 48px;
color: #FFFFFF;
left: 50%;
top: 50%;
margin-left: -24px;
margin-top: -24px;
}
/* 属性触碰mor-grid盒子之后 iconfont进行蹦跳动画 */
.content-part .moregrid:hover .iconfont {
animation: ud .4s ease 0s infinite alternate;
}
@keyframes ud {
from {
transform: translateY(-20deg);
}
to {
transform: translateY(20deg);
}
}
.content-part .moregrid ul {
margin-top: 112px;
padding-left: 30px;
}
.content-part .moregrid ul li {
float: left;
color: #FFFFFF;
border-right: 1px solid white;
padding: 0 9px;
height: 17px;
font-size: 14px;
line-height: 15px;
}
.content-part .moregrid ul li:last-child {
border-right: none;
}
/* 当地玩乐 */
.ddwl {
padding-top: 40px;
height: 546px;
background-color: #F7F7F7;
}
.ddwl .hd h2 {
float: left;
margin-right: 12px;
}
.ddwl .hd em {
position: relative;
top: 22px;
font-size: 12px;
color: #000000;
}
.ddwl .hd nav {
width: 336px;
}
.ddwl .bd {
padding-top: 32px;
}
.ddwl .bd .col {
float: left;
width: 364px;
height: 480px;
margin-right: 30px;
}
.ddwl .bd .col:last-child {
margin-right: 0;
}
.ddwl .bd .bigpicbox {
width: 364px;
height: 270px;
background-color: red;
margin-bottom: 30px;
position: relative;
overflow: hidden;
}
.ddwl .bd .bigpicbox .info {
position: absolute;
width: 364px;
height: 104px;
color: #FFFFFF;
font-size: 14px;
line-height: 22px;
background-color: rgba(0, 0, 0, .42);
bottom: 0;
left: 0;
}
.ddwl .bd .bigpicbox .info .proname {
padding: 17px 21px 43px 21px;
}
.ddwl .bd .bigpicbox .info .tag {
position: relative;
color: #FFFFFF;
top: -32px;
left: 19px;
}
.ddwl .bd .bigpicbox .info .price {
position: relative;
top: -53px;
left: 276px;
color: #FFFFFF;
}
/* 数字为#36DFBA字体颜色 在i标签内部 需单独设置 */
.ddwl .bd .bigpicbox .info .price i {
color: #36DFBA;
}
.ddwl .bd .grid {
width: 364px;
height: 120px;
margin-bottom: 30px;
background-color: #FFFFFF;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.08);
}
.ddwl .bd .grid .picbox {
float: left;
width: 120px;
height: 120px;
overflow: hidden;
}
.ddwl .bd .grid .wordbox {
float: left;
width: 244px;
height: 120px;
font-size: 14px;
padding: 26px 18px;
box-sizing: border-box;
color: #000000;
}
.ddwl .bd .moregrid {
width: 364px;
height: 270px;
background-image: linear-gradient(180deg, #FF6374 1%, #FF7368 98%);
}
.ddwl .bd .moregrid ul {
padding-left: 20px;
}
/* 鼠标触碰阴影变深 */
.ddwl .bd .grid:hover,
.ddwl .bd .bigpicbox:hover,
.ddwl .bd .moregrid:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.20);
}
/* 特色当地体验 */
.tsddty {
height: 456px;
background-color: #FFFFFF;
margin-top: 40px;
}
.tsddty .hd h2 {
text-align: center;
margin-bottom: 32px;
}
.tsddty .bd ul li {
float: left;
width: 264px;
height: 290px;
margin-right: 32px;
background-color: #FFFFFF;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.08);
}
.tsddty .bd ul li .wordbox {
padding: 16px 14px 0;
}
.tsddty .bd ul li:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.20);
}
.tsddty .bd ul li:last-child {
margin-right: 0;
}
.tsddty .bd .proname {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: bold;
height: 48px;
}
.tsddty .bd .score {
font-size: 12px;
color: #FA6400;
line-height: 18px;
}
.tsddty .bd .comment {
font-size: 12px;
color: #000000;
line-height: 18px;
}
/* 最世界深度旅行 */
.zsjsdlx {
height: 738px;
background-color: #F7F7F7;
}
.zsjsdlx .hd em {
float: left;
}
.zsjsdlx .hd nav {
float: right;
width: 87px;
}
.zsjsdlx .bd .moregrid {
background-image: linear-gradient(180deg, #BD5EE8 0%, #832ABB 98%);
}
.zsjsdlx .bd .moregrid ul {
padding-left: 37px;
}
.zsjsdlx .bd ul li:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.20);
}
/* 跟团半自助游 */
.gtbzzy .hd nav {
width: 157px;
}
.gtbzzy .bd .moregrid {
background-image: linear-gradient(180deg, #41D8E9 0%, #3685EA 98%);
}
.gtbzzy .bd .moregrid ul {
padding-left: 37px;
}
/* 动画遮罩效果 */
/* 同时拥有两条属性 完成不同页面的相同动画效果 */
.biggrid.havehover .mask {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .7);
/* 总透明度 */
opacity: 0;
/* 过渡 */
transition: opacity .4s ease 0s;
}
.biggrid.havehover:hover .mask {
opacity: 1;
}
.biggrid.havehover .circle {
position: absolute;
top: -106px;
left: 50%;
margin-left: -53px;
width: 106px;
height: 106px;
border: 1px solid white;
border-radius: 50%;
color: white;
padding-top: 30px;
box-sizing: border-box;
font-size: 18px;
transition: top .4s linear 0s;
}
.biggrid.havehover .circle p {
text-align: center;
}
.biggrid.havehover:hover .circle {
top: 62px;
}
.biggrid.havehover .word {
position: absolute;
bottom: -100px;
left: 30px;
color: white;
font-size: 14px;
transition: bottom .4s linear 0s;
}
.biggrid.havehover:hover .word {
bottom: 30px;
}
/* 页脚 */
footer .part1 {
padding-top: 36px;
height: 220px;
background-color: #F7F7F7;
}
footer .part1 ul {
padding-top: 36px;
}
footer .part1 ul li {
float: left;
padding: 0 30px;
height: 16px;
line-height: 16px;
border-right: 1px solid #1C1F21;
}
footer .part1 ul li:first-child {
padding-left: 0;
}
footer .part1 ul li:last-child {
border-right: none;
padding-right: 0;
}
footer .part1 ul li a {
font-size: 18px;
color: #1C1F21;
}搜索
复制
3
收起
正在回答 回答被采纳积分+1
1回答
好帮手慕小李
2022-05-05 11:01:29
同学你好,在同学提的另一个问题中做了回复https://class.imooc.com/course/qadetail/324838 。
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星