How to use <iframe> tag inside <a href=" ">

1324 views html

So, my plan is to show some image on page and if user click on that image he will be redirected to some certain page of some website inside of format of that image.

I tryed something like this:

<a href="">
<iframe src="demo_iframe.htm" width="665" height="235"></iframe>

But, obvious it's not working...

answered question

1 Answer


Can you explain what you are trying to do?

What I understood was, if someone tries to click on that iframe you want them to redirect to some other link!

For this, you can use JS. Wrap it inside Div and make onClick for that div and in that function you can do href to new location.

posted this

Have an answer?


Please login first before posting an answer.