Open In App

How to create a full-width Container in Tailwind CSS?

Creating a full-width Container in Tailwind CSS involves using the container class along with additional utility classes like mx-auto to centre the content. The container class ensures that the content remains within a fixed width, and mx-auto centres it horizontally.

Syntax:

<div class="container mx-auto">
<!-- Content goes here -->
</div>

Classes

Class Description
container Provides a fixed-width container for content, restricting its width to a predefined maximum size.
mx-auto Centres the container horizontally by setting the left and right margins to auto.

Key Features

Article Tags :