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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:52:36+00:00 2026-05-25T05:52:36+00:00

The problem I found is the following: Situation : I have overall div that

  • 0

The problem I found is the following:

Situation: I have overall div that has a inline-block display. Inside it are two element that have an inline-block display as well.

Then I add (thanks to JavaScript) a <br/> between the two elements. The second goes to the next line, which is the normal behavior.

Buggy part: The <br/> is then removed (JavaScript again) and… the display doesn’t change. It appears that the box of the overall div is not recalculated. In the end I have two similar markup that doesn’t appear the same way (which is a bit problematic, isn’t it).

It works fine on Firefox (it appears to be webkit based as the Android browser behave the same way). So my question is, is there a workaround that doesn’t use methods that will alter the DOM? The library used is jQuery.

A test case here.

EDIT: As suggested by duri, I filled a bug report in webkit bugzilla, it’s here. But I’m still looking for a workaround ;)

  • 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-25T05:52:37+00:00Added an answer on May 25, 2026 at 5:52 am

    Way what I found: remove all childs from overall DIV, and then append all except BR’s:

    function removeBr(){
        var ahah=document.getElementById("ahah");
        var childs=[],child;
        while(child=ahah.firstChild) {
            if(!child.tagName||child.tagName.toLowerCase()!=='br')
                childs.push(child);
            ahah.removeChild(child);
        }
        for(var i=0;i<childs.length;i++)
            ahah.appendChild(childs[i]);
    }
    

    http://jsfiddle.net/4yj7U/4/

    Other variant:

    function removeBr(){
        var node=$("#ahah")[0];
        node.style.display='inline';
        $("#ahah").children("br").remove(); 
        setTimeout(function(){node.style.display='';},0);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following use case: I have a class that has two methods
I found the following lines in a makefile tutorial, but I have some problem
I have the following situation. ( A jsfiddle of this can be found here
i have a little big problem. My problem is the following. I´ve got two
I did my research but haven't found an answer to the following problem: I
We have encountered a very strange class not found problem in our web app
I'am currently working on GWTs Activity-Place implementation. Now I have found problem with the
I have a problem with NSDateFormatter and iOS. I actually found a recognition AND
I have the following situation I handle when the left mouse button is pressed
Following situation: I have an array with some constant values, which represent ranges. A

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.