css - Css:我怎样才能从右到左显示这个图像?
问题描述
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;
}
}
解决方案
没有更多代码很难给出可靠的答案,但是根据您发布的内容,将容器的绝对位置更改为,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
,具体取决于您希望图像的显示方式。
推荐阅读
- javascript - 从正则表达式循环中获取哈希值?
- powerbi - 如何在 Power BI 中将 HOUR 转换为介于 BETWEEN_HOUR 之间?
- arrays - ESPAsyncWebServer 从 RAM 提供大型阵列
- c - GIO:如何启用 GMenuItem?GMenu 启用/禁用
- swift - DatePicker 返回错误的日期 Swift 5
- javascript - 不能上传多张图片上传视频
- javascript - 如何自动格式化我已抓取的整个表格?
- reactjs - 带有反应的firebase:signInWithEmailAndPassword似乎既没有失败也没有成功
- docker - Docker:如何在 Dockerfile 中将变量添加到 ENTRYPOINT
- python - Python将字符串行附加到其他字符串行