Next.js Discord

Discord Forum

Shifting next images or changing position with respect to parent div styles

Avatar
issue-
i am trying to move the svg to right with respect to parent div i did manage to style with respect to parent div using image fill but cant chane the width of imagee and it should have overflow hidden \

Expected-
image should move to right side and overflow shold get hidden
Image
Image
Image
Answered by Dayo
i have an idea. since it's a decorative element, you can use it as a background image instead

so, your code will look like:

<div className="bg-[url('/art.svg')] absolute bg-cover bg-right bg-no-repeat"></div>
View full answer

22 Replies

Avatar
Atlantic herring
by overflow do u mean z-index?
do u want the text to be on top of the strip?
Avatar
see the design on the image you will get the idea
Avatar
Philippine Crocodile
parent has relative?
beacuase i need that at the end
Avatar
Philippine Crocodile
the element that you want to absolutely position it right to needs to have relative on it
potentially this is some container div or body?
Avatar
Yus its a position div you can see the code
In img
Avatar
And also im tryed using relative but it won't work and have same results
Avatar
object-position: right
@Dayo
Avatar
i have an idea. since it's a decorative element, you can use it as a background image instead

so, your code will look like:

<div className="bg-[url('/art.svg')] absolute bg-cover bg-right bg-no-repeat"></div>
Answer
Actually i can also try out the style tag 😅