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

  • SEARCH
  • Home
  • 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 6148693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:19:28+00:00 2026-05-23T19:19:28+00:00

Kind of a weird example, but here goes: How do I get an absolutely

  • 0

Kind of a weird example, but here goes:

How do I get an absolutely positioned DIV to expand when content is inserted that goes beyond its borders? Here is the code:

<html>
<head>
    <style>
        * {margin: 0; padding: 0;}
        body {white-space: nowrap; text-align: center; color: white; font-size: 2em;}
        div#container {position: relative; height: 100px; width: 50px;}

        div#a {height: 50px; width: 25px; background-color: red; position: absolute; top: 0; left: 0;}
        div#b {height: 50px; width: 25px; background-color: blue; position: absolute; top: 0; right: 0}
        div#c {height: 50px; width: 25px; background-color: orange; position: absolute; bottom: 0; left: 0;}        
        div#d {height: 50px; width: 25px; background-color: purple; position: absolute; bottom: 0; right: 0;}

        span#title {position: relative; overflow: visible}
    </style>
</head>
<body>
    <div id="container">
        <div id="a"><span id="title">This is my title</span></div>
        <div id="b">B</div>
        <div id="c">C</div>
        <div id="d">D</div>
    </div>
</body>

In the example above, the content in DIV “a” is hidden (due to the width/height restrictions). If we set this to “min-height” and “min-width” the content just sits “behind” the other divs, but doesn’t move them. How can I accomplish this?

Note: I’m trying to figure this out, as I need to “reposition” the order in which DIVs are ordered in the HTML (I’m trying to make a child template in WordPress). Any examples/resources are GREATLY appreciated.

Cheers,
Sapiensgladio

  • 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-23T19:19:29+00:00Added an answer on May 23, 2026 at 7:19 pm

    You can use min-height and min-width to define the minimum values for those dimensions, which will be expanded to accommodate new/additional/larger content as necessary.

    You can couple with the max-height and max-width attributes, which will allow the elements to move from the minimum, as necessary, to the maximum permitted value for the dimension.

    Example CSS:

    #content {
        position: absolute;
        min-height: 5em;
        max-height: 15em;
        min-width: 5em;
        max-width: 15em;
        border: 1px solid #f90;
        bottom: 0.5em;
        right: 0.5em;
        overflow: auto;
    }
    

    JS Fiddle demo.

    The above demo uses jQuery to add extra content to the #content div, but that’s just for dynamic demonstration purposes, the jQuery is not, in any way, required for the css to work.

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

Sidebar

Related Questions

It's kind weird, but I can't fulfill a pretty common operation with git. Basically
Kind of a weird question, but. I need to have a list of strings
This is kind of a weird problem, but I have to create a search
Hey, I got kind of a weird issue here. I have an iPhone-only OpenGL
I'm running into a small but weird annoyance that seems to be happening to
This is kind of weird but I'd like to serve multiple websites on the
I´m getting the error Calling the function GetListItems but is kind weird because it
I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but
I got a kind of weird problem: I want to fade images. The Code
This is kind of a weird question and more of an annoyance than technical

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.