Angular Material 2 container

天大地大妈咪最大 提交于 2020-02-24 12:41:48

问题


I'm new to Angular material 2 and I'm accustomed to using bootstrap 4.1. So this question may seem simple, but how does one create a "container" in Angular material 2?

For example in a bootstrap container in will create a left and right margin for the entire app, can this be achieved easily with Angular material 2?


回答1:


Well it all depends on your layout. If you have all your content in one card, you don't need to mind about anything, the card will be nicely displayed thanks to its set width. However if you have several cards or if you wish to have a particular layout, you can always achieve the same thing as you said about bootsrtap (about the margin) by setting the margin yourself in the parent .scss of your project (name should be style.scss), it will then apply to your whole app. Also, if you use FlexLayout (link) you might not even have to set a margin (it all depends on how you use it though, but I use it in my app, and combined with material components, I never had to mind about setting any margin to define a container).

So as you see there are many things that can do it for you, or you can do it yourself, it all depends on what kind of layout you want to use



来源:https://stackoverflow.com/questions/51093880/angular-material-2-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!