How to wrap query loop using html tag a

I have query loop inside query loop. the output i expected is:

Category [query loop]
Post [query loop 3 posts]

When i am using either container, dib, block the output is correct. but i need to wrap post query loop using a tag. so its clickable and can redirect to detail post page.

For the structure is like this.

This is the output when i try to use tag a, with dynamic data {posts_url}. its like, the a tag cannot wrapping structure inside.

i put the output image here.