Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-sonnet-4-20250514· AnthropicHugging Face LMArena Human Preference 140K

I want an overflow on the y axis but not on the x axis, the x axis overflow should be…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-flash’s answer.
  1. User

    I want an overflow on the y axis but not on the x axis, the x axis overflow should be visible, please research and tell me how to do this correctly

  2. Claude Assistant

    You can achieve this using CSS by setting different overflow values for each axis:

    .container {
      overflow-x: visible;
      overflow-y: auto; /* or scroll, or hidden */
    }
    

    The overflow-x and overflow-y properties let you control overflow behavior independently for each axis. Here are your options:

    For X-axis (horizontal):

    • overflow-x: visible - content extends beyond the container boundaries and remains visible

    For Y-axis (vertical):

    • overflow-y: auto - shows scrollbars only when content overflows
    • overflow-y: scroll - always shows scrollbars
    • overflow-y: hidden - clips overflowing content without scrollbars

    A complete example:

    .my-container {
      width: 300px;
      height: 200px;
      overflow-x: visible;
      overflow-y: auto;
      border: 1px solid #ccc;
    }
    

    This approach works reliably across modern browsers. The key is using the axis-specific properties rather than the shorthand overflow property, which would apply the same behavior to both axes.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.