第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

CSS:如何將最后一個(gè)元素向左對(duì)齊

CSS:如何將最后一個(gè)元素向左對(duì)齊

ibeautiful 2023-12-11 15:27:43
由于 justify-content: space-around 規(guī)則,當(dāng)?shù)?4 個(gè)塊向下跳時(shí),它變成了中間我可以以某種方式仍然使用空格規(guī)則,但使最后一個(gè)塊不要跳到中心,而是跳到左側(cè),就像屏幕截圖中那樣?PS我仍然需要 justify-content: space-around 因?yàn)樗哂许憫?yīng)式邊距這是代碼https://jsfiddle.net/s4fbtkyg/<html><body><style>  .block{  background-color: grey;  flex-basis: 100px;  margin-bottom: 5px;}.container{  display: flex;  flex-wrap: wrap;  justify-content: space-around;}</style><div class="container">  <div class="block">1</div>  <div class="block">2</div>  <div class="block">3</div>  <div class="block">4</div> </div></body></html>截屏
查看完整描述

1 回答

?
莫回?zé)o

TA貢獻(xiàn)1865條經(jīng)驗(yàn) 獲得超7個(gè)贊

您可能需要考慮使用 CSS 網(wǎng)格來完成此任務(wù):


grid-template-columns: repeat(auto-fit, 100px); //100px being the width of your choosing

這是代碼:


超文本標(biāo)記語言


<!DOCTYPE html>

<html>

<head>

  <meta charset="UTF-8">

  <title>Document</title>

</head>

<body>

<div class="container">

  <div class="block">1</div>

  <div class="block">2</div>

  <div class="block">3</div>

  <div class="block">4</div>

 </div>

</body>

</html>

CSS


.block{

  background-color: grey;

}


.container{

  display: grid;

  grid-gap: 5px;

  grid-template-columns: repeat(auto-fit, 100px);

  justify-content: space-around; //you can still use justify-content: space-around


}

小提琴:小提琴鏈接


查看完整回答
反對(duì) 回復(fù) 2023-12-11
  • 1 回答
  • 0 關(guān)注
  • 196 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)