search

Home  >  Q&A  >  body text

angular.js - Using angular with angular-material cannot obtain the width and height of the card


I set an instruction water-fall for the outermost p, and then wanted to get the md-card and offsetWidth of its sub-element offsetHeight, but the The values ​​are all 0, and the command code is as follows:


The results are as follows


And I have added width to each card in the style sheet,

I hope someone can help solve this problem, Crab.

仅有的幸福仅有的幸福2798 days ago795

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-15 17:02:26

    As long as the page is rendered, its height will not change. It only has a min-height attribute. If the card is large, it will be stretched by the content inside

    reply
    0
  • Cancelreply