YouTube使用<a href="">

时间:2018-06-15 15:22:04

标签: iframe youtube embed

I am trying to implement you tube embed video using <a href>. it seems not displaying the youtube video and unresponsive. I am not seeing any issue in Jquery or CSS issue. It's working with <iframe src> but not working with <a href> and would like to implement with a tag

No working:

  <a href="https://www.youtube.com/embed/tgbNymZ7vqY" target="_blank" class="youtube-play-icon launch-youtube-modal"></a> 

Working:

<iframe src="https://www.youtube.com/embed/tgbNymZ7vqY" target="_blank" class="youtube-play-icon launch-youtube-modal"></iframe> 

1 个答案:

答案 0 :(得分:1)

除非您希望此人访问其他网页以观看视频,否则链接似乎没有意义。 iframe将在没有人离开页面的情况下显示视频