[Fixed]-How can I center align(responsive) materialize forms for Django?

1👍

I’m guessing your wanting to center both horizontally and vertically. For this I personally recommend you to use flex in your css. If you don’t have a css file this is the first thing you will need to get setup. Checkout this Question here for a comprehensive answer about doing this in Django.
Setting up django for css file

CSS

.card {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card form {
    max-width: 100%; /* Handles the responsive part, it will cause your form to scale with a max-width of 100% */
}

Checkout this guide on flexbox created by Chris at CSS Tricks. Its great and covers everything you need to know about centering.
https://duckduckgo.com/?q=complete+guide+to+centering+css

Leave a comment