Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 974851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:29:48+00:00 2026-05-16T03:29:48+00:00

This is a test case: <!doctype html> <html> <body> <div style=margin: 0 auto; width:

  • 0

This is a test case:

<!doctype html>
<html>
<body>
    <div style="margin: 0 auto; width: 950px; overflow: hidden;">
        <div style="float: left; width: 660px">
            <form><fieldset>
            <pre style="overflow: auto">Test test test Test test test Test test test Test test test Test test test Test test test Test test test Test test test </pre>
            </fieldset></form>
        </div>
        <div style="float: right; width: 260px">
            Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. Lorem Ipsum. 
        </div>
    </div>
</body>
</html>

I want the code in <pre> to show a scroll bar instead of overflowing into the “Lorem Ipsum” sidebar. If it’s in a <fieldset> (as in the example) it overflows.

If you remove the <form><fieldset> it won’t overflow anymore, but it won’t show the scrollbar either (the overflowed text is simply clipped).

Here is what I want:

  • If the text in the <pre> is longer than the available width it shouldn’t overflow into “Lorem Ipsum” and it should show a scroll bar, whether it is in a <fieldset> or not.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:29:49+00:00Added an answer on May 16, 2026 at 3:29 am

    It is obeying it, but in the context of it’s default behavior. It doesn’t have a width currently, and the default behavior of a <pre> is to not have a width (but rather to expand into available space…and it’s parent is willing to expand to accommodate it) so it’s acting correctly.

    If you want it to fit, just give it the same width as the parent, like this:

    <pre style="overflow: auto; width: 660px;">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this pared-down test case: <!DOCTYPE html> <html><head><title>No Underline Please</title> <style type=text/css> li {
I have these pieces of HTML: <li class=icon iconDelete><a href=/projects/delete/{id}/ title=Delete this test case.></a></li>
Why doesn't this test case work? <?php // cards with cyrillic inidices and suits
I have this test case def setUp(self): self.user = User.objects.create(username=tauri, password='gaul') def test_loginin_student_control_panel(self): c
How can it be that this test case import unittest class PropTest(unittest.TestCase): def test(self):
I'm having a problem getting this test case to work. Can anyone point me
This is a minimal test case of some code that I actually have. It
This is an output of Boost.Test when test case failes: bjam toolset=msvc ...patience... ...found
This is a pretty esoteric issue that I can't produce a small test case
This is for Play! Framework 2.0. I'm trying to write a simple test case

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.