我正在使用 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; }
- 1 回答
- 0 關注
- 71 瀏覽
添加回答
舉報
0/150
提交
取消