GC Design System CSS Shortcuts
GC Design System Start to use Page templates overview Basic page Components overview Breadcrumbs Button Card Checkboxes Container Date input Date modified Details Error message Error summary Fieldset File uploader Footer Grid Header Heading Icon Input Language toggle Link Notice Pagination Radios Screenreader-only Search Select Side navigation Signature Stepper Text Textarea Theme and topic menu Top navigation CSS shortcuts overview Reset styles Responsive layout State Box sizing Container sizing Display Overflow Position Visibility Font Font family Font size Font style Font weight Line height Link colour Link size Link text decoration List style Text align Text colour Text overflow Text transform Word break Margin Padding Align content Align items Align self Flex Flex direction Flex grow Flex shrink Flex wrap Gap Grid columns Grid rows Justify content Justify items Justify self Order Place content Place items Place self Background colour Border colour Border radius Border style Border width Icon names Icon size Image Cursor Pointer events Transition Styles overview Design tokens Colour tokens Spacing tokens Typography tokens Contact us Get involved Find a demo

Overflow

The overflow class sets the overflow property. It controls how content is handled when it does not fit in its container and overflows.

Overview

CSS Shortcut class Applied style
overflow-visible
overflow: visible;
overflow-x-visible
overflow-x: visible;
overflow-y-visible
overflow-y: visible;
overflow-hidden
overflow: hidden;
overflow-x-hidden
overflow-x: hidden;
overflow-y-hidden
overflow-y: hidden;
overflow-scroll
overflow: scroll;
overflow-x-scroll
overflow-x: scroll;
overflow-y-scroll
overflow-y: scroll;

Examples

Visible
overflow-visible

Content that doesn’t fit in this element overflows horizontally and vertically.
<div class="overflow-visible">
  Content that doesn’t fit in this element overflows horizontally and vertically.
</div>

Visible horizontal (x)
overflow-x-visible

Content that doesn’t fit in this element overflows horizontally.

<div class="overflow-x-visible" style="width: 250px;">
  <p style="width: 500px;">
    Content that doesn’t fit in this element overflows horizontally.
  </p>
</div>

Visible vertical (y)
overflow-y-visible

Content that doesn’t fit in this element overflows vertically.
<div class="overflow-y-visible">
  Content that doesn’t fit in this element overflows vertically.
</div>

Hidden
overflow-hidden

Content that doesn’t fit in this element is invisible, but still exists for screenreaders.

<p class="overflow-hidden">
  Content that doesn’t fit in this element is invisible, but still exists for screenreaders.
</p>

Hidden horizontal (x)
overflow-x-hidden

Content that doesn’t fit to the left and right of this element is invisible, but still exists for screenreaders.

<div class="overflow-x-hidden" style="width: 250px;">
  <p style="width: 500px;">
    Content that doesn’t fit to the left and right of this element is invisible, but still exists for screenreaders.
  </p>
</div>

Hidden vertical (y)
overflow-y-hidden

Content that doesn’t fit above or below this element is invisible, but still exists for screenreaders.

<p class="overflow-y-hidden">
  Content that doesn’t fit above or below this element is invisible, but still exists for screenreaders.
</p>

Scroll
overflow-scroll

<a href="#" class="overflow-scroll">
  Content that doesn’t fit in this element can be scrolled to with vertical and horizontal scrollbars.
</a>

Scroll horizontal (x)
overflow-x-scroll

<a href="#"  class="overflow-x-scroll" style="width: 250px;">
  <p style="width: 500px;">
    Content that doesn’t fit in this element can be scrolled to with a horizontal scrollbar.
  </p>
</a>

Scroll vertical (y)
overflow-y-scroll

<a href="#" class="overflow-y-scroll">
  Content that doesn’t fit in this element can be scrolled to with a vertical scrollbar.
</a>

Conditional styling Apply this style to specific screen sizes Use a responsive layout prefix to apply this class only to a specified screen size. The available breakpoints are:

  • xs: > 480px
  • sm: > 640px
  • md: > 768px
  • lg: > 1024px
  • xl: > 1280px
  
<div class="xs:overflow-hidden ...">
  ...
</div>
  

Learn more about the responsive layout prefix.

2025-10-01