Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have the following code
HTML
<iframe src="http://www.w3schools.com" width="100%"></iframe>
<iframe src="http://www.google.com" width="100%"></iframe>


when i run it in the browser the first iframe works fine but the second doesn't show the webpage. i tried other links like yahoo or instagram or twitter, but have the same result empty ifram.
Posted

1 solution

Width of d browser window is considered as 100%. First iFrame itself consume full width. So second I frame is getting hidden. Make width 50% for both. Or else, add these I frames in difft rows ( element).
 
Share this answer
 
Comments
Nasser Abu Farah 6-Feb-15 22:13pm    
Thank you for responding. I tried your solution but still having the same problem.
even if keep only one iframe with no width.
the problem with the link its self, if use http://www.w3schools.com then it works, but if i use http://www.google.com or yahoo.com or instagram.com or twitter.com then it show an empty iframe.
Shridhar Gowda 7-Feb-15 21:41pm    
Try https for google. Or else, simply use google.com it will automatically append http/https.
Shridhar Gowda 9-Feb-15 1:05am    
I think google is having some security reasons not to showing on iframe. Check it out. You may get an Idea.
https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900