【问题标题】:Css: How can I reveal this image from right to left?Css:我怎样才能从右到左显示这个图像?
【发布时间】:2021-08-07 13:31:33
【问题描述】:

这里是 CSS 新手。 我有这张图片,我想从右到左显示它,我需要添加/更改这个代码吗?

.arr1 {
    display:block;
    position:absolute;
    left:1001px;
    top:920px;
    width:0;
    height:99px;
    background:url(../img/arr1.png) no-repeat;
    background-size:254px 99px;
    opacity: 0;
    transition: 0.5s linear;
    pointer-events: none;

    &:hover{
    opacity: 1;
    pointer-events: all;
    width: 254px;
    transition-delay: 1s;
    }
}

【问题讨论】:

    标签: css css-transitions transition right-to-left


    【解决方案1】:

    没有更多代码很难给出可靠的答案,但是根据您发布的内容,将容器的绝对位置更改为right 而不是left,并将图像的宽度添加到前left值,结果为 1255px:

    .arr1 {
        display:block;
        position:absolute;
        right:1255px;
        top:920px;
        width:0;
        height:99px;
        background:url(../img/arr1.png) no-repeat;
        background-size:254px 99px;
        opacity: 0;
        transition: 0.5s linear;
        pointer-events: none;
    
        &:hover{
        opacity: 1;
        pointer-events: all;
        width: 254px;
        transition-delay: 1s;
        }
    }
    

    您可能还想将background-position: right 添加到.arr1,具体取决于您希望图像的显示方式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-15
      • 2020-06-27
      • 1970-01-01
      • 2021-09-10
      相关资源
      最近更新 更多