使用 Bootstrap 對齊媒體物件


要對齊媒體物件,請在 Bootstrap 中使用 class “align”。你可以嘗試執行以下程式碼來實現 class “align”。

使用 class “align-left” 將媒體對齊到左側 −

示例

現場演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
      <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "container">
         <h2>Google Tag Manager Tutorial</h2>
         <div class = "media">
            <div class = "media-left">
               <img src = "https://tutorialspoint.tw/latest/Google-Tag-Manager.png" class="media-object" style="width:60px">
            </div>
            <div class = "media-body">
               <h4 class = "media-heading">Introduction</h4>
               <p>Google Tag Manager (GTM) is a free tool that makes it easy for marketers to add and update website tags.</p>
            </div>
         </div>
      </div>
   </body>
</html>

更新於:2020 年 6 月 15 日

137 次瀏覽

開啟你 職業生涯

透過完成本課程來獲得認證

開始學習
廣告
© . All rights reserved.