What am I doing wrong?
.jacket-left,
.jacket-right{
background: url("https://i.imgur.com/baApP9x.png") no-repeat -2px -2px;
}
.jacket-right{
background-position: -2px -84px;
}
What am I doing wrong?
.jacket-left,
.jacket-right{
background: url("https://i.imgur.com/baApP9x.png") no-repeat -2px -2px;
}
.jacket-right{
background-position: -2px -84px;
}
Hi there asasass,
you must either do it like this…
.jacket-left,
.jacket-right {
background-image: url(https://i.imgur.com/l0QmDbB.png);
background-repeat: no-repeat;
background-position: -2px -2px;
}
.jacket-right {
background-position: -2px -84px;
}
…or like this…
.jacket-left {
background: url(https://i.imgur.com/baApP9x.png) no-repeat -2px -2px;
}
.jacket-right {
background: url(https://i.imgur.com/baApP9x.png) no-repeat -2px -84px;
}
Mixing shorthand and longhand is the cause of the problem.
coothead
How come shorthand property works in this instance?
.container-left .jacketd,
.container-left .wraph {
background: url("https://i.imgur.com/baApP9x.png") no-repeat 0 0;
}
.container-left .wraph {
background-position: 0 -600px;
}
But this won’t work like this.
.jacket-left,
.jacket-right{
background: url("https://i.imgur.com/baApP9x.png") no-repeat -2px -2px;
}
.jacket-right{
background-position: -2px -84px;
}
It is working but as you are only offsetting by 84px you still get the same black square. The rest of the image is miles below that.
.jacket-right{
background-position: -2px -600px;
}
I was using the wrong image url.
Fixed:
.jacket-left,
.jacket-right{
background: url("https://i.imgur.com/baApP9x.png") no-repeat -2px -2px;
}
.jacket-right{
background-position: -2px -84px;
}
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.