Log In Sign Up
HomeDocsBasicWidth & Height

Width & Height

Category: Basic
Users can independently control width and height using _w-* and _h-* style classes. Dimensions use input height as the base unit (e.g., _w-1 equals 40px, _w-6 equals 40*6px). Includes three special si...

Introduction

In web pages, some elements have undefined widths that need to be manually set, including:

  1. Inline elements (display:inline/inline-flex/inline-block) whose width depends on content
  2. Elements in flex layouts that become inline due to nesting
  3. Absolutely positioned elements (position:fixed/absolute) that lose their default 100% width
  4. Block elements in multi-column layouts that need to leave space for others

Width Styles

The framework provides a width system using box-sizing:border-box with two approaches:

  1. Absolute widths based on form field height (4rem/40px)
  2. Relative percentage widths

Detailed specifications:

Class Name Description
_w-0 0px width
_w-1 4rem (40px) width
_w-2 4rem × 2 (80px)
_w-3 4rem × 3 (120px)
_w-4 4rem × 4 (160px)
_w-5 4rem × 5 (200px)
_w-6 4rem × 6 (240px)
_w-7 4rem × 7 (280px)
_w-8 4rem × 8 (320px)
_w-9 4rem × 9 (360px)
_w-10 4rem × 10 (400px)
_w-neat Matches input field width (4rem × 10)
_w-half/_w-1of2 50% width
_w-1of3 33.3% width
_w-2of3 66.7% width
_w-1of4 25% width
_w-3of4 75% width
_w-full 100% width
_w-auto Auto width
_w-iso aspect-ratio =1/1

The style class `_w-iso` does not define a width value, but if the node already has a height value, the node's width will equal its height.
  • Output
  • HTML
  •                 
                    
                

Height Styles

Following the same design principles as width, the height classes are:

Class Name Description
_h-0 0px height
_h-1 4rem (40px) height
_h-2 4rem × 2 (80px)
_h-3 4rem × 3 (120px)
_h-4 4rem × 4 (160px)
_h-5 4rem × 5 (200px)
_h-6 4rem × 6 (240px)
_h-7 4rem × 7 (280px)
_h-8 4rem × 8 (320px)
_h-9 4rem × 9 (360px)
_h-10 4rem × 10 (400px)
_h-neat Matches input field height (4rem)
_h-half/_h-1of2 50% height
_h-1of3 33.3% height
_h-2of3 66.7% height
_h-1of4 25% height
_h-3of4 75% height
_h-full 100% height
_h-auto Auto height
_h-iso aspect-ratio =1/1

The style class `_h-iso` does not define a height value, but if the node already has a width value, the node's height will equal its width.
  • Output
  • HTML
  •                 
                    
                

New Launch: 20% Off All Products

Unlock all examples and development resources