Search code examples
cssmaterialize

MaterializeCSS .container suddenly not working


My .container in materialize CSS always took up the entire screen.

            .container {
                width: 100%;
            }

but suddenly I opened it and it looks as though its back to the 70% container.

I thought maybe I accidentally deleted some code, but when I opened my back up of my website it too appeared as though the container was only 70% of the screen. It's weird because it wasn't like that and now every page has a tiny container. I tried making the container width bigger and it cuts things off my screen. I also tried making all the rows wider but it just made my content stretch too much.


Solution

  • MaterializeCSS specifically defines the class container to be a max-width of 1280px and a width of 90%

    Therefore, if you wish to still use this class but want it altered, you would either edit the materialize.css or in a separate .css file, declared UNDER the materialize.css:

    .container{
        max-width: 100%;
        width:100%;
    }
    

    You could also define these inline, however that is not recommended