Container

Primary container element for page layout

Demo

Container is centered in its parent, has responsive padding, and its content will be contained according to maxwidth.

See more examples

API

Tag

Name Type Content
m-container Custom tag Any

Attributes

Name Value Description
maxwidth
  • lg default
  • md
  • sm
  • none
Sets the max width of the container, which includes some padding. "lg" grows up to 1536px, "md" starts at 800px and shrinks down, and "sm" starts at 576px and shrinks down.
Read more on maxwidth for details.

Guidelines

More on maxwidth

By default Container will grow up to 1,536 pixels wide, which is intended to make full use of a screen up to the equivalent of a 16" MacBook Pro. You can remove this limit with none.

In cases where there isn't a full page of content or maybe a more focused layout is desired, md is often the right width. On-boarding flows or a promotional page are good examples where medium would be useful. In some cases a very narrow and focused layout is needed, like a log in form. Use sm for these.

In all cases Container includes padding and centers itself in the viewport.

Multiple containers

A page can have multiple containers. This is most common when two components should share the same container characteristics, like max width and centered in the viewport, but need to have different backgrounds or other design elements that prevent sharing a single container. A site navigation is a good example:

LOGO

And the rest of the page's content is here in another container.

Note how this section and the site nav's content are aligned.

Other layout elements

In addition to Mdash's Container and Grid, HTML offers a number of semantic elements for layout. From W3Schools:

Accessibility

There are no accessibility recommendations for Container.