# Overflow

Control what happens when content too big either scroll/clip

* `visible` - Default. The overflow is not clipped. The content renders outside the element's box
* `hidden` - The overflow is clipped, and the rest of the content will be invisible
* `scroll` - The overflow is clippgit ed, and a scrollbar is added to see the rest of the content
* `auto` - Similar to `scroll`, but it adds scrollbars only when necessary

Only happens if block display with height, or rather if some parent has a defined height that is not based on contents (max-height doesn't count?)

The scrollbar actually takes up space in the div

**Make sure container is overflow hidden** so it constrains the inner divs, then you can add auto(scrollbar) to the child

## Text-Overflow

```css
overflow: hidden;
white-space:nowrap;
text-overflow: hidden;
```

## Advanced

On mobile, you can run into weird bouncing issues with the window scrolling instead of the content

Check out: <https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://openai.gitbook.io/code-cheatsheets/css/overflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
