CSS overflow-y property

CSS overflow-y

CSS overflow-y can be used, when the content overflows along the y-axis (Top or Bottom) in the elements container.

Using this property we can add scroll bars or clip some of the contents.

CSS overflow-y property values are

  • visible
  • hidden
  • scroll
  • auto

visible value for css overflow-y property

It is the default value. The overflowing content is not clipped, it is displayed outside the elements box.

Example

Try Yourself

hidden value for css overflow-y property

The overflowing content is clipped, only the remaining can be seen.

Example

Try Yourself

scroll value for css overflow-y property

The overflowing content is clipped, and scroll bar is added. So that the clipped content can be seen.

Example

Try Yourself

auto value for css overflow-y property

If the overflowing content is clipped, scroll bar is added.

Example

Try Yourself