Loading Please Wait...

Logo Lynxsia IT Solutions

CSS Overflow

CSS Overflow

The CSS overflow property controls what happens to content that is too big to fit into an area.

  • overflow-x
  • overflow-y
  • overflow
Overflow Values

visible: Overflow content is not clipped and may be visible outside the element's padding box.

hidden: Overflow content is clipped at the element's padding box.

clip: Overflow content is clipped at the element's overflow clip edge that is defined using the overflow-clip-margin property. The difference between clip and hidden is that the clip keyword also forbids all scrolling, including programmatic scrolling.

scroll: Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view using scroll bars.

auto: Overflow content is clipped at the element's padding box, and overflow content can be scrolled into view. Unlike scroll, user agents display scroll bars only if the content is overflowing and hide scroll bars by default.

Global values: inherit, initial, revert, revert-layer, unset.

Overflow Horizontally

The CSS overflow-x property sets what shows when content overflows a block-level element's left and right edges.

					 
        
          /* Keyword values */
          overflow-x: visible;
          overflow-x: hidden;
          overflow-x: clip;
          overflow-x: scroll;
          overflow-x: auto;

          /* Global values */
          overflow-x: inherit;
          overflow-x: initial;
          overflow-x: revert;
          overflow-x: revert-layer;
          overflow-x: unset;
        
      
Overflow Vertically

The CSS overflow-y property sets what shows when content overflows a block-level element's top and bottom edges

					 
        
          /* Keyword values */
          overflow-y: visible;
          overflow-y: hidden;
          overflow-y: clip;
          overflow-y: scroll;
          overflow-y: auto;

          /* Global values */
          overflow-y: inherit;
          overflow-y: initial;
          overflow-y: revert;
          overflow-y: revert-layer;
          overflow-y: unset;
        
      
Overflow Both

The CSS overflow is a shorthand property that sets the desired behavior when content does not fit in the parent element box (overflows) in the horizontal and/or vertical direction.

					 
        
          /* Keyword values */
          overflow: visible;
          overflow: hidden;
          overflow: clip;
          overflow: scroll;
          overflow: auto;
          overflow: hidden visible;

          /* Global values */
          overflow: inherit;
          overflow: initial;
          overflow: revert;
          overflow: revert-layer;
          overflow: unset;
        
      
Overflow Clip Margin

The CSS overflow-clip-margin property determines how far outside its bounds an element with overflow: clip may be painted before being clipped.

					 
        
          /* length values */
          overflow-clip-margin: 20px;
          overflow-clip-margin: 1em;

          /* visual-box | length*/
          overflow-clip-margin: content-box 5px;

          /* Global values */
          overflow-clip-margin: inherit;
          overflow-clip-margin: initial;
          overflow-clip-margin: revert;
          overflow-clip-margin: revert-layer;
          overflow-clip-margin: unset;
        
      
If the element does not have overflow: clip then overflow-clip-margin property will be ignored and overflow: clip behaves like overflow: hidden if overflow-clip-margin property not set.

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved