How to change the default width of container in MaterializeCSS?

16,873

Just override the property by making sure that your style is read by the browser after linking to, or importing materialize.css

You would need to copy and change these values:

.container {
  margin: 0 auto;
  max-width: 1280px;
  width: 90%;
}
@media only screen and (min-width: 601px) {
  .container {
    width: 85%;
  }
}
@media only screen and (min-width: 993px) {
  .container {
    width: 70%;
  }
}
Share:
16,873
B Faley
Author by

B Faley

Updated on July 29, 2022

Comments

  • B Faley
    B Faley over 1 year

    The default width of container is set to 70% in MaterializeCSS:

    The container class is not strictly part of the grid but is important in laying out content. It allows you to center your page content. The container class is set to ~70% of the window width. It helps you center and contain your page content. We use the container to contain our body content.

    How could this be changed?