css - How to avoid Horizontal scroll bar while using FlexLayoutModule in angular
问题描述
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-property-feed',
templateUrl: './property-feed.component.html',
styleUrls: ['./property-feed.component.scss']
})
export class PropertyFeedComponent implements OnInit {
property =[1,2,3,4,5,6,7,8,9,10];
constructor() { }
ngOnInit() {
}
}
button {
margin: 5px 5px 5px 5px;
}
.feed-title {
font-size: 30px;
font-family: "Girassol", cursive;
}
.property-feed {
width: 300px;
height: 410px;
}
.row-class{
overflow:;
}
<div class="row-class" fxLayout="row" >
<ng-container *ngFor="let ppty of property">
<div fxFlex>
<mat-card class="property-feed">
<mat-card-header>
<div mat-card-avatar class="avatarImage"></div>
<mat-card-title>Card Title</mat-card-title>
<mat-card-subtitle>Card Subtitle</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<app-gallery></app-gallery>
<h3>some informaion to the end user</h3>
</mat-card-content>
<mat-card-footer>
</mat-card-footer>
<mat-card-actions>
<button matTooltip="If intrested contact seller" mat-fab large color="primary">
<mat-icon>thumb_up_alt</mat-icon>
</button>
<button matTooltip="If intrested add to wishlist" mat-fab large color="warn">
<mat-icon>add_shopping_cart</mat-icon>
</button>
<button matTooltip="View details" mat-fab large color="warn">
<mat-icon>unfold_more</mat-icon>
</button>
</mat-card-actions>
</mat-card>
</div>
</ng-container>
</div>
Thanks in advance :)
解决方案
css flex 行不会包装组件,您可能需要将 wrap 与行一起使用。https://github.com/angular/flex-layout/wiki/fxLayout-API
<div fxLayout="row wrap">
<div>1. One</div> <div>2. Two</div> <div>3. Three</div> <div>4. Four</div>
</div>
推荐阅读
- windows - 如何批量循环数组并移动文件
- python - 从 PyQt5 中的循环同时更新和显示数据
- java - 为什么 JDBI 中的查询可以关闭?
- c# - 在特定毫秒内安排作业计划
- docker - Docker绑定挂载权限-意外挂载为root:root
- sql - 根据 SQL Server 中的不同表将数据添加到新列
- python - '忽略命令中的异常无:discord.ext.commands.errors.CommandNotFound:找不到命令“测试”'Discord py中的错误
- javascript - updateOne 返回“matchedCount”:0,“modifiedCount”:0
- r - 在 R 包中的 rcpp-function 中使用自定义 Rcpp 类。类和函数都定义在同一个 .cpp 文件中
- c - 我得到一个“错误:重新定义”符号,即使我在文件前面使用了相同的语法,