首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在媒体中嵌套“关键帧”

在媒体中嵌套“关键帧”
EN

Stack Overflow用户
提问于 2017-12-04 08:55:25
回答 1查看 786关注 0票数 0

我得用花括号修复一个错误。但所有的括号都有一对。第212行有错误

预期RBRACE在第212行,col 2. @-webkit-关键帧移动{

但是当我在212之前和212之后分别测试代码时,没有发现错误。

代码语言:javascript
复制
@media all and (min-width:  1px){
.main-pointing-slider .box .dot-4{
    bottom: -2px;
    left: 128px;
    top: auto;
    right: auto;
    bottom: -2px;
    left: calc(50% - 3px);
    position: absolute;
    -webkit-animation-name: dotShow;
    -webkit-animation-duration: 0.5s;
    -webkit-animation-delay: 2s;
    -webkit-animation-timing-function: linear;
    -moz-animation-name: dotShow;
    -moz-animation-duration: 0.5s;
    -moz-animation-delay: 2s;
    -moz-animation-timing-function: linear;
    animation-name: dotShow;
    animation-duration: 0.5s;
    animation-delay: 2s;
    animation-timing-function: linear;
    -webkit-animation-fill-mode: forwards;
    -moz-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
    background: linear-gradient(to bottom, #dcd4cb 0%, #f3c886 100%)
}
.main-pointing-slider .box .svg-gradient{
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: absolute
}
.main-pointing-slider .box .svg-gradient .svg-box{
    width: 100%;
    height: 100%
}
.main-pointing-slider .box .svg-gradient .svg-box rect{
    visibility: visible
}
.main-pointing-slider .slide{
    /*display: none;*/
    width: 100%;
    height: 100%;
    top: 0;
    /*position: absolute;*/
    overflow: hidden
}
.main-pointing-slider .slide .point{
    top: 1px;
    right: 0;
    bottom: 0;
    left: 1px;
    position: relative;
    width: 248px;
    height: 126px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-border-radius: 120px;
    -moz-border-radius: 120px;
    border-radius: 120px;
    opacity: 0;
    margin: 0
    auto
}
.main-pointing-slider .slide .point .svg-gradient-point{
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: absolute;
    z-index: 2
}
.main-pointing-slider .slide .point .svg-gradient-point .svg-box{
    width: 100%;
    height: 100%
}
.main-pointing-slider .slide .point .svg-gradient-point .svg-box rect{
    stroke-width: 2
}
.main-pointing-slider .slide .point .point-inner{
    top: 0;
    right: auto;
    bottom: auto;
    left: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-border-radius: 120px;
    -moz-border-radius: 120px;
    border-radius: 120px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
    background: no-repeat 50%;
    background-size: cover
}
.main-pointing-slider .slide .point-shadow{
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: absolute;
    width: 260px;
    height: 130px;
    width: calc(260px - 6px);
    height: calc(130px - 6px);
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-border-radius: 120px;
    -moz-border-radius: 120px;
    border-radius: 120px;
    opacity: 0;
    z-index: 3;
    margin: 0
    auto;
    background: black
}
.main-pointing-slider .slide .upper-text{
    top: auto;
    right: -100%;
    bottom: 72%;
    left: auto;
    position: absolute;
    width: 62%;
    text-transform: uppercase;
    text-align: right;
    font-size: 13px;
    font-family: "Tahoma Bold",sans-serif;
    font-weight: 600;
    line-height: 1.12;
    color: #e7c28b;
    display: none
}
.main-pointing-slider .slide .lower-text{
    top: 34%;
    right: -100%;
    bottom: auto;
    left: auto;
    position: absolute;
    width: 53%;
    font-size: 12px;
    font-family: "Tahoma Regular",sans-serif;
    line-height: 1.3;
    text-align: right;
    color: white;
    display: none
}
.main-pointing-slider .slide.active{
    display: block
}
.main-pointing-slider.startFirstFrame .line{
    -webkit-animation-name: move;
    -webkit-animation-duration: 0.9s;
    -webkit-animation-delay: 0s;
    -webkit-animation-timing-function: ease;
    -moz-animation-name: move;
    -moz-animation-duration: 0.9s;
    -moz-animation-delay: 0s;
    -moz-animation-timing-function: ease;
    animation-name: move;
    animation-duration: 0.9s;
    animation-delay: 0s;
    animation-timing-function: ease
}
.slide.animationIn .point{
    -webkit-animation-name: point;
    -webkit-animation-duration: 1s;
    -webkit-animation-delay: 0s;
    -webkit-animation-timing-function: ease-out;
    -moz-animation-name: point;
    -moz-animation-duration: 1s;
    -moz-animation-delay: 0s;
    -moz-animation-timing-function: ease-out;
    animation-name: point;
    animation-duration: 1s;
    animation-delay: 0s;
    animation-timing-function: ease-out;
    -webkit-animation-fill-mode: forwards;
    -moz-animation-fill-mode: forwards;
    animation-fill-mode: forwards
}
.slide.animationIn .point-shadow{
    -webkit-animation-name: point;
    -webkit-animation-duration: 1s;
    -webkit-animation-delay: 0s;
    -webkit-animation-timing-function: ease-out;
    -moz-animation-name: point;
    -moz-animation-duration: 1s;
    -moz-animation-delay: 0s;
    -moz-animation-timing-function: ease-out;
    animation-name: point;
    animation-duration: 1s;
    animation-delay: 0s;
    animation-timing-function: ease-out;
    -webkit-animation-fill-mode: forwards;
    -moz-animation-fill-mode: forwards;
    animation-fill-mode: forwards
}
.slide.animationIn .upper-text{
    animation: slideLeft 0.5s 0.25s ease forwards, slideLeftFinish 0.25s 0.75s ease forwards;
}
.slide.animationIn .lower-text{
    animation: slideLeft 0.5s 0.5s ease forwards, slideLeftFinish 0.25s 1s ease forwards;
}
@-webkit-keyframes move {
    0% {
        -webkit-transform: scaleX(0.1);
        -moz-transform: scaleX(0.1);
        -ms-transform: scaleX(0.1);
        transform: scaleX(0.1);
        opacity: 1
    }
    100% {
        -webkit-transform: scaleX(1);
        -moz-transform: scaleX(1);
        -ms-transform: scaleX(1);
        transform: scaleX(1);
        opacity: 1
    }

}

}

由于这个错误,验证器无法在@media中看到一个壁橱括号。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-12-04 09:22:52

根据W3C规范:

@media中的At-规则在CSS2.1中无效。

参考文献:www.w3.org -媒体类型

,所以这是行不通的:

代码语言:javascript
复制
@media (max-width: 768px) {

   @media (max-width: 450px) {

   }

}

也不会这样:

代码语言:javascript
复制
@media (max-width: 768px) {

   @-webkit-keyframes animation {

   }

}

关键帧动画应声明在任何媒体类型之外,然后应用在适用的或相关的媒体安静时,并在必要时。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47629625

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档