Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 角度材质:在mat芯片右侧显示图标_Css_Angular_Angular Material_Angular Material 5 - Fatal编程技术网

Css 角度材质:在mat芯片右侧显示图标

Css 角度材质:在mat芯片右侧显示图标,css,angular,angular-material,angular-material-5,Css,Angular,Angular Material,Angular Material 5,我有一个垫子芯片,里面有内容。我还有一个取消图标。 我将mat芯片设置为固定宽度,因此我希望取消图标始终向右浮动。但是取消图标没有向右浮动。我尝试了多种css技术,但都不起作用 <mat-chip *ngIf= "item?.name"> {{ item.name}} <mat-icon matChipRemove (click)="removeAssignments(dataItem)">cancel</mat-icon> </mat-ch

我有一个垫子芯片,里面有内容。我还有一个取消图标。 我将mat芯片设置为固定宽度,因此我希望取消图标始终向右浮动。但是取消图标没有向右浮动。我尝试了多种css技术,但都不起作用

<mat-chip *ngIf= "item?.name">
   {{ item.name}}
   <mat-icon matChipRemove (click)="removeAssignments(dataItem)">cancel</mat-icon>
</mat-chip>

{{item.name}
取消

好的
mat-chip
显示:inline-flex
作为一个属性,因此您需要使用flex相关属性操作子元素。对于您的情况:

mat-chip {
  justify-content: space-between;
}
我会成功的。如果你想充分体验棱角材料,可以使用flexbox,因为有很多东西都在使用它