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

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

角度材料卡布局

角度材料卡布局

米琪卡哇伊 2023-09-11 16:55:36
我正在使用 Angular Mat 卡,并且有一個按鈕,每次單擊該按鈕時都會在數據庫中創建新卡,但新卡顯示在現有卡的底部,兩者之間沒有任何間隙,所以如果你們可以提供幫助我弄清楚如何制作間隙/邊距,這會很棒。謝謝這就是現在的樣子這就是我想要的樣子 .clickable {     cursor: pointer; } .mat-chip {     background-color: #DFDFDF;     text-align: left;     font: Regular 16px/21px Roboto;     letter-spacing: 0.29px;     color: #000000DE;     opacity: 1;     border-radius: 18px;     opacity: 1; } .mat-card {     margin-left: -10px;     padding: 0;     margin-bottom: 20px;;     width: 350px;     height: auto;     cursor: pointer;           } .chipMargin{     margin-left: 5%;     margin-right: 5%; } .mat-chip-list {   display: table-row;   flex-direction: column; }@media screen and (min-width:768px){.divider {   height: 90%;    position: absolute;     left: 900px;    right: 830px;    top: 40px;  }.column {    float: left;    width: 950px;    padding: 10px;    margin-left: 30px;    margin-top: 10px;    }.column2 {    width: 730px;    float: right;    right: 70px;    position: absolute;  }.row:after {    content: "";    display: table;    clear: both;  }  .inline-block {    display: inline-block;  }}
查看完整描述

1 回答

?
慕的地10843

TA貢獻1785條經驗 獲得超8個贊

你只需要將 margin-bottom CSS 屬性添加到你的卡片中,如下所示:

.mat-card:not(:last-child) {
  margin-bottom: 20px;
}

編輯:

我仔細查看了您的代碼,發現您沒有創建卡片,而是在卡片內創建列表項。您的ngFor指令被放置在a標簽上。將ngFor指令放在卡片上,或者如果您想創建列表項,請添加以下代碼:

.mat-list-item:not(:last-child) {
  margin-bottom: 20px;
}


查看完整回答
反對 回復 2023-09-11
  • 1 回答
  • 0 關注
  • 71 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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