@media screen and (min-width: 768px) { .title { font-size: 34px; text-align: center; margin-top: 100px; } .main { .case { -webkit-box-sizing: border-box; box-sizing: border-box; &:nth-child(1) { padding-top: 80px !important; } &:nth-child(odd) { height: 690px; padding: 120px 0; .cover { width: 668px; height: 410px; } } &:nth-child(even) { height: 720px; padding: 162px 0; background: url(/img/case-bg.png) no-repeat center; background-size: auto 720px; .cover { width: 568px; height: 397px; } } .cover { background: pink; } .content { position: relative; background: skyblue; width: 490px; height: 410px; margin-top: 50px; img { display: block; width: 580px; height: 516px; position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } } .cover { position: relative; .cover-title { position: absolute; left: 0; top: 20%; font-size: 24px; color: #fff; background: #0688d2; padding: 0 20px; line-height: 48px; } &.fr { .cover-title { top: 10%; left: -40px; } } img { display: block; width: 100%; height: 100%; } } } } .footer { margin-top: 0; } } @media screen and (max-width: 768px) { .title { font-size: 0.34rem; text-align: center; margin-top: 0.8rem; } .main { .case { -webkit-box-sizing: border-box; box-sizing: border-box; margin-top: 0.4rem; .content { position: relative; margin: 0 auto; width: 6.14rem; float: unset !important; margin-top: -1.2rem; img { display: block; width: 6.14rem; } } .cover { position: relative; float: unset !important; margin: 0 auto; width: 6.14rem; text-align: center; .cover-title { font-size: 0.26rem; color: #fff; background: #0688d2; padding: 0 0.29rem; line-height: 0.56rem; display: inline-block; margin-bottom: 0.4rem; } img { display: block; width: 100%; height: 100%; } } } } .footer { margin-top: 0; } }