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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:42:24+00:00 2026-05-28T07:42:24+00:00

I don’t know how to title this more accurately. So I have dynamically generated

  • 0

I don’t know how to title this more accurately.

So I have dynamically generated content…basically <p> elements that represent bookmark tags that a user creates….as the element count increases I want the content below them to naturally move down..so there is no overlap.

I do this by creating an absolutely positioned element with two relatively positioned elements in it like this: (SO contributed – note below)

<style> 
    #wrapper { position:absolute; } 
    #i_will_expand { position:relative; top:0px; left:0px; } 
    #i_will_move_down { position:relative; top:0px; left:0px; } 
</style> 

<div id="wrapper"> 
    <div id="i_will_expand"><p class="single_tag">content here</p></div> 
    <div id="i_will_move_down"></div> 
</div> 

I think this would work but because I have my <p> elements floated they take up no space (the magical CSS kind that doesn’t exist when you think it should)…like this:

p.single_tag
{
    padding:                    2px;
    margin:                     2px;    
    border:                     1px solid #dddddd;
    float:                      left;
    font-size:                  14px;
    color:                      #888888;
    cursor:                     pointer;
}

Hence my div holding the tags has no y dimension…hence the div below it never moves down…and snap my tags flow into my bookmarks.

Now I thought why not remove the float..so that I get “real space”…this does not work…b.c now…the p elements flow down instead of to the left….so I thought…why don’t I set the display to inline so the elements flow left to right….cool, but now they ignore the width property…I mean they keep flowing to the right for all eternity….so…..I punched myself in the head a few times (not realy)…and thought…how can I fix this….

After posting somebody mentioned a property…something about ‘word break’ and I added this property in and I had hope….I understood CSS…it was treating…my continuous

elements as one long word…that’s right it was treating multiple paragraphs as one long word…but if I made words breakbable…then it would now follow the width property…….however….

now my tags were broken b.c. they got split in two at line breaks…plus all my top and bottom margins disappeared..so they were complety fubarred and unusable eseentially….back to the drawing board 3 hours later.

Please help if there is a viable CSS solution to expanding <p> elements.
I’m just going to do this in Javascript if there is not a viable CSS solution.

Related

https://stackoverflow.com/questions/8963183/width-property-is-seemingly-ingored-by-expanding-p-elements

positioning relative to an absolute positioned element – is it possible?

When do nested child elements expand their parent elment?

  • 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-28T07:42:24+00:00Added an answer on May 28, 2026 at 7:42 am

    Further to Kolink’s answer, you could also apply overflow:hidden; to the #i_will_expand element, which should force it to wrap around and contain its child elements. To give:

    #i_will_expand { position:relative; top:0px; left:0px; overflow: hidden; } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know why this double json response are not successful: [{first_content:content,...}][{second_content:content,...}] So i
Don't know if this has been answered before. Have custom routes to users. If
Don't know why but I can't find a solution to this. I have 3
Don't know if there is a better way to do this, so that is
Don't really know how to formulate the title, but it should be pretty obvious
Don't know if I worded the question right, but basically what I want to
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know if this has been asked before, so point me to another question
I don't know how better to describe this. So take this example. var a
Don't overthink this - there's a very commonly used term and I ... have

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.