我有一个固定宽度的单选按钮组,我想让按钮标签换行。我尝试在html的每个部分添加类,并在元素中添加“空白: normal”,但它忽略了它。我怎么才能让它工作呢?
Here is an example of where I am at
如果我将这个CSS添加到顶级styles.scss文件中,它会按预期工作。
.mat-radio-label-content {
white-space: normal;
}但我想避免这种情况,并保持css只与特定的组件相关,而不是整个应用程序。
发布于 2017-12-28 23:55:34
使用选择器将标签文本换行到跨度中。
<style>
.wrap-mat-radio-label {
white-space: normal;
}
</style>
<mat-radio-group>
<mat-radio-button>
<span class="wrap-mat-radio-label">
{{ season }}
</span>
</mat-radio-button>
</mat-radio-group>https://stackoverflow.com/questions/47894524
复制相似问题