Reputation: 95
Basically I have this mat-card
:
<mat-card>
<mat-card-content>
<div *ngFor="let siteSource of siteSources | paginate: { itemsPerPage: 5, currentPage: page};">
<site-details [site]='siteSource'></site-details>
</div>
</mat-card-content>
</mat-card>
And for each element I have this HTML
:
<div *ngIf="site" class="col-xs site-details">
<div>
<tr>
<td class="col-sm-6"><label>http://www.{{site._source.url}}.com.br</label></td>
<td class="col-sm-2">
<a routerLink="editSite/{{site._id}}" style="text-decoration: none; color: white"
routerLinkActive="active">
<button mat-raised-button color="primary">
Editar
</button>
</a>
</td>
<td class="col-sm-2"><button mat-raised-button color="warn"
(click)="openConfirmationDialog('excluir',site._source.url)">Excluir
</button></td>
<td class="col-sm-2"> <a target="_blank" href="http://www.{{site._source.url}}.com.br" title="Ir ao site"><button
mat-raised-button>Ir ao site</button></a>
</td>
</tr>
</div>
<hr>
</div>
<router-outlet></router-outlet>
The problem is that when I change to the mobile vision my buttons get out of the mat-card
:
Is there a way to keep the content inside the mat-card
equally responsive?
Upvotes: 2
Views: 1640
Reputation: 15031
There are a few things going on
<div>
if you include the Bootstrap CSS (which i did in index.html)col-sm-6 or col-sm-2
combinations (from Bootstrap) wouldn't work with Angular-material card because the card has a maximum width of 400px... whilst, the col-sm
grid classes are applied when the the width is between 576px - 768pxcol-[99]
classes, since width is less than 576pxcheck the demo here - note: I removed the router-outlet just to avoid setting up routing for the sample;
Upvotes: 1