亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Bootstrap 沒有完美地將內容居中

Bootstrap 沒有完美地將內容居中

繁星淼淼 2023-12-04 19:27:27
我有這個簡單的代碼:      <div class="container branduri justify-content-center">    <div class="row justify-content-center"> <div class="col-xl-4">  <h1><strong>+100</strong></h1> </div> <div class="col-xl-4">  <h1><strong>+100</strong></h1> </div> <div class="col-xl-4">   <h1><strong>+100</strong></h1> </div>問題是,在我的網站上,正如您在附圖中看到的那樣,列沒有完美居中。為什么?
查看完整描述

2 回答

?
繁星coding

TA貢獻1797條經驗 獲得超4個贊

在行 div 上添加 bootstrap 類text-center

class="row justify-content-center text-center"


查看完整回答
反對 回復 2023-12-04
?
叮當貓咪

TA貢獻1776條經驗 獲得超12個贊

您只需將此屬性添加到行text-align:center;或添加 Bootstrap 類,即可將每列中的文本居中text-center,如下所示:


<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container branduri justify-content-center">

     <div class="row justify-content-center text-center">

          <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">

               <h1><strong>+100</strong></h1>

          </div>

          <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">

               <h1><strong>+100</strong></h1>

          </div>

          <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">

               <h1><strong>+100</strong></h1>

          </div>

     </div>

</div>


查看完整回答
反對 回復 2023-12-04
  • 2 回答
  • 0 關注
  • 170 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號