2026年11月16日月曜日

スマホ縦動画 Bloggerの動画投稿の場合の表示について

Tailwind cssでしか、もう私は書かないのだ!

動画 11.29 御堂筋パレード に参加よろしくお願いします!



<!--Tailwind CSS CDN-->
<script src="https://cdn.tailwindcss.com"></script>

<!--🎥 動画セクション(縦長動画・ぴったりフィット版)-->
<section class="bg-white p-5 sm:p-8 rounded-xl shadow-sm text-center my-6">
  <h3 class="text-lg font-bold text-gray-900 mb-3 flex items-center justify-center">
    <span class="bg-red-600 text-white text-xs px-2 py-1 rounded mr-2">動画</span> 11.29 御堂筋パレード に参加よろしくお願いします!
  </h3>
  
  <!--縦長動画用(max-w-xsでスマホの縦型動画に適した細めの幅にし、余計な黒帯をなくす)-->
  <div class="max-w-xs mx-auto rounded-lg overflow-hidden shadow bg-black">
    <div class="relative w-full" style="padding-bottom: 0px;"> <!--縦長動画用のアスペクト比 (9:16)-->
<div class="separator" style="clear: both; text-align: center;">
<object aria-label="御堂筋パレ―ド" class="BLOG_video_class" contentid="9983ba1bf2a89a77" height="560px" id="BLOG_video-9983ba1bf2a89a77" width="315px"></object>

</div>
</div>
</div>
</section>
この、objectの部分は、Bloggerの読み込みの動画を吸い込んだ状態で、widthとheightだけを縦対応にすることです。

次に、縦の動画を2つ並べる場合。 これはYoutubeを2個並べています。
 


<div class="flex flex-col md:flex-row justify-center items-center gap-6 my-6">
  <!--1つ目の動画-->
  <div class="w-full flex justify-center">
    <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="560" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/ruhp_c4SZfU?si=cCOYqP2Ug075Bo6B&cc_load_policy=1" title="YouTube video player" width="315"></iframe>
  </div>

  <!--2つ目の動画-->
  <div class="w-full flex justify-center">
    <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="560" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/G31d5sMGpqU?si=q5Ca0F9uUpWoZT2L&cc_load_policy=1" title="YouTube video player" width="315"></iframe>
  </div>
</div>

縦動画は、スマホでぴったりと見れるのでいいですね。

お問合せフォーム

お名前 :
Email: (必須)
メッセージ: (必須)

 約束しないと、送信できません。再度の場合はリロードが必要です。


0 コメント :

コメントを投稿

コメントありがとうございます。


サイト内検索


View My Stats