角材料垫卡宽度作为内部文本宽度

时间:2019-09-10 16:12:16

标签: javascript html css angular angular-material

卡的宽度始终为100%。

Demo

我会调整垫板宽度以适合文本宽度(带有一些填充)

<mat-card>Simple card</mat-card>

2 个答案:

答案 0 :(得分:1)

您应该向--- output: rmdformats::html_clean: highlight: kate toc: true use_bookdown: true --- ```{r setup, include=FALSE} knitr::opts_chunk$set( class.source = "numberLines lineAnchors" ) ``` ```{r} 5 + 5 3 * 9 ``` ```{r} x <- 5 x * 3 ``` <!-- The javascript below will reset the line numbers when the document loads. --> <script> $(function() { $(".sourceLine").each( function( index ){ $( this ).attr( "data-line-number", index + 1 ); }); }); </script> 申请我在下面编写的CSS。

mat-card

答案 1 :(得分:0)

您可以简单地为mat-card写一些CSS并根据需要设置width属性。 例如:

mat-card {
  width: 50%;
}