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 8256757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:57:59+00:00 2026-06-08T01:57:59+00:00

Is there a non javascript way to stretch an element either in relation to

  • 0

Is there a non javascript way to stretch an element either in relation to its parent (if the content is too short) or following the content. Here are three images to explain the topic:

little content
This is a divpositioned absolute with top, bottom etc at 20px

lot content
This is the some situation with more content “breaking” the div which is not the way it should be.

Should look like this
You get the idea?

  • 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-06-08T01:58:02+00:00Added an answer on June 8, 2026 at 1:58 am

    Sure, don’t position: absolute the inner div.

    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
        #outer {
            background: #ccc;
            padding: 20px;
            margin: 20px;
            width: 200px;
            height: 100px;
            overflow-y: auto;
        }
        #inner {
            background: white;
            border: 1px black solid;
            box-sizing: border-box;
            min-height: 100%;                
        }
    </style>
    <div id=outer>
        <div id=inner>
            <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum
                tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas
                semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien
                ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean
                fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec
                non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque
                egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan
                porttitor, facilisis luctus, metus</p>
        </div>
    </div>
    

    Live Example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way that I can add non-static data to dataannotation attributes (either
Is there a non-javascript way of changing the color of a label when the
I'm building a non-javascript version of a website, as there are a number of
There are some ARIA tutorial websites use non-semantic markup and some javascript to demostrate
Is there any non-hacky way to determine wether a class' superclass implements a particular
Is there a way to make a variable non-inheritable in python? Like in the
Is there a way for a non admin user to check the uptime of
Is there any way to make only a non-transparent portion of an image to
Is there any way to get iPhone coordinates without relying on javascript callback events?
Is there any way to randomly access the URLs in Javascript's History object in

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.