VOOZH about

URL: https://bulma.io/documentation/elements/box/

⇱ Box | Bulma: Free, open source, and modern CSS framework based on Flexbox


πŸ‘ Image

Learn CSS with πŸŽ“ online interactive courses,πŸ“Ί educational videos, and πŸ§‘πŸ»β€πŸ’»project-building tutorials.

Start Here

Features

Sass Tools

Customization

CSS Library

CSS Helpers

Sponsor

πŸ‘ Route Planner and Route Optimizer

Box


A white box to contain other elements

The box element is a simple container with a white background, some padding, and a box shadow.

Example

I'm in a box.

HTML

<div class="box">I'm in a box.</div>

Because it acts as a container, you can easily include other components, like form elements:

Example

HTML

<form class="box">
 <div class="field">
 <label class="label">Email</label>
 <div class="control">
 <input class="input" type="email" placeholder="e.g. [email protected]" />
 </div>
 </div>

 <div class="field">
 <label class="label">Password</label>
 <div class="control">
 <input class="input" type="password" placeholder="********" />
 </div>
 </div>

 <button class="button is-primary">Sign in</button>
</form>

Or a media object:

Example

John Smith @johnsmith 31m
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean efficitur sit amet massa fringilla egestas. Nullam condimentum luctus turpis.

HTML

<div class="box">
 <article class="media">
 <div class="media-left">
 <figure class="image is-64x64">
 <img src="https://bulma.io/assets/images/placeholders/128x128.png" alt="Image" />
 </figure>
 </div>
 <div class="media-content">
 <div class="content">
 <p>
 <strong>John Smith</strong> <small>@johnsmith</small>
 <small>31m</small>
 <br />
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean
 efficitur sit amet massa fringilla egestas. Nullam condimentum luctus
 turpis.
 </p>
 </div>
 <nav class="level is-mobile">
 <div class="level-left">
 <a class="level-item" aria-label="reply">
 <span class="icon is-small">
 <i class="fas fa-reply" aria-hidden="true"></i>
 </span>
 </a>
 <a class="level-item" aria-label="retweet">
 <span class="icon is-small">
 <i class="fas fa-retweet" aria-hidden="true"></i>
 </span>
 </a>
 <a class="level-item" aria-label="like">
 <span class="icon is-small">
 <i class="fas fa-heart" aria-hidden="true"></i>
 </span>
 </a>
 </div>
 </nav>
 </div>
 </article>
</div>

Sass and CSS variables #

Sass Variable
CSS Variable
Value
$box-background-color
var(--bulma-box-background-color)
var(--bulma-scheme-main)
$box-color
var(--bulma-box-color)
var(--bulma-text)
$box-radius
var(--bulma-box-radius)
var(--bulma-radius-large)
$box-shadow
var(--bulma-box-shadow)
var(--bulma-shadow)
$box-padding
var(--bulma-box-padding)
1.25rem
$box-link-hover-shadow
var(--bulma-box-link-hover-shadow)
0 0.5em 1em -0.125em hsla(
 var(--bulma-scheme-h),
 var(--bulma-scheme-s),
 var(--bulma-scheme-invert-l),
 0.1
),
0 0 0 1px var(--bulma-link)
$box-link-active-shadow
var(--bulma-box-link-active-shadow)
inset 0 1px 2px hsla(
 var(--bulma-scheme-h),
 var(--bulma-scheme-s),
 var(--bulma-scheme-invert-l),
 0.2
),
0 0 0 1px var(--bulma-link)

How to support Bulma

One-time donation

Browser testing via

πŸ‘ Image
πŸ‘ Image

Visit our Sponsors

Monthly donation

Become a sponsor
πŸ‘ Image
#native_company# #native_desc#
#native_cta#
πŸ‘ Image
πŸ‘ Image
Get started for Free
πŸ‘ Image
πŸ‘ Image
Get started for Free