Skip to content
Advertisement

how to ovelap a image on other image by styling scss in reactjs?

I have a design. In this design, one is overlapping on another image. I have created some code to try as given in the design. but it’s not working for me. Click here to find the design

Below is some line of code of components. that is tried by me

JavaScript

below is a style in scss

JavaScript

Click Here to check what I have designed. but it’s not looking as given in design.

How can I style the same as given in Design? And should be responsive also.

Advertisement

Answer

To achieve the demo image you can eliminate the border with transparency for the img2 that has higher stack order in DOM.

JavaScript

To make it responsive, the image width seems very small but you need to adjust the width & margin according to the device size using media query.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement