Next.js Discord

Discord Forum

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

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
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

Atlantic herring
by overflow do u mean z-index?
do u want the text to be on top of the strip?
Philippine Crocodile
parent has relative?
beacuase i need that at the end
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?
Yus its a position div you can see the code
In img
And also im tryed using relative but it won't work and have same results
@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>
Answer
Actually i can also try out the style tag 😅