I’m using TailwindCSS and trying to implement a shimmer effect for an item card component.
I’m trying to build exactly the same item card but with static data to be replaced while the dynamic data is being fetched. the problem is although I’m using h-full and w-full it does not occupy 100% width of its parent.
2
Answers
Add
w-full
to the parent divOutput:
I removed the second div and it worked like so:
Also if you want the red background to be full width and height of the Image before it loads up, just add ‘height’ property to the element in ItemCardShimmer component and it will work. It worked for me.