angular material: vertically arranging contents in a mat-grid-tile

前端 未结 2 2081
轻奢々
轻奢々 2021-01-04 21:32

I am using angular material and have a grid list component with two tiles. the problem is the contents are getting arranged left to right rather top to bottom.



        
2条回答
  •  暖寄归人
    2021-01-04 22:08

    The reason it's horizontal is because the Material lib is wrapping your tags located inside mat-grid-tile in a flex styled element that has a row flex-direction by default.

    If I get it right, the code below should do want you want. When using grid-list elements, the order has an importance

    
        
            

    Title

    some sort of text in between

    You could also wrap the content of your mat-grid-tile in a div:

    
        
            

    Title

    some sort of text in between

提交回复
热议问题