Documentation
IntroductionLayout
Text
- Accordion
- Alert
- Animation
- Align
- Badge
- Base
- Breadcrumb
- Button
- Card
- Close
- Comment
- Description List
- Divider
- Dotnav
- Drop
- Dropdown
- Filter
- Form
- Height
- Icon
- Iconnav
- Image
- Inverse
- Label
- Leader
- Lightbox
- Link
- List
- Margin
- Marker
- Modal
- Nav
- Navbar
- Notification
- Off-canvas
- Overlay
- Padding
- Pagination
- Parallax
- Placeholder
- Position
- Print
- Progress
- Scroll
- Scrollspy
- Search
- Section
- Slidenav
- Slider
- Slideshow
- Sortable
- Spinner
- Sticky
- Subnav
- SVG
- Switcher
- Tab
- Table
- Thumbnav
- Tile
- Toggle
- Tooltip
- Totop
- Transition
- Upload
- Utility
- Video
- Visibility
Container
This component allows you to align and center your page content.
Usage
Add the .uk-container
class to a block element to give it a max-width and wrap the main content of your website. The element will be centered and have padding on the sides, that adapts automatically for large screens.
Note The padding of nested containers will be removed to avoid unnecessary spacing.
<div class="uk-container"></div>
Size modifiers
Add one of the following classes to the container to apply a different max-width.
Class | Description |
---|---|
.uk-container-xsmall |
Add this class for a xsmall container. |
.uk-container-small |
Add this class for a small container. |
.uk-container-large |
Add this class for a large container. |
.uk-container-xlarge |
Add this class for a xlarge container. |
.uk-container-expand |
Add this class, if you do not want to limit the container width but still want the dynamic horizontal padding. |
<div class="uk-container uk-container-xsmall"></div>
<div class="uk-container uk-container-small"></div>
<div class="uk-container uk-container-large"></div>
<div class="uk-container uk-container-xlarge"></div>
<div class="uk-container uk-container-expand"></div>
Container in sections
You can apply this component to modify the width of content inside sections from the Section component.
<div class="uk-section uk-section-primary">
<div class="uk-container uk-container-small"></div>
</div>