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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:12:52+00:00 2026-06-02T19:12:52+00:00

This question seems to get asked a lot, but I can’t find an answer

  • 0

This question seems to get asked a lot, but I can’t find an answer that works for me.

Here is a link to an example (see also HTML below): http://biskup.biowiki.org/blah.html

I want the text to flow after the link, but it doesn’t. (I’m looking at this in Firefox & Chrome, on a Mac.)

I’d like to pre-empt some of the common replies I’ve seen, e.g. here Prevent linebreak after </div>

Regarding those answers:

  • I can’t set the div’s display property to “inline” or “inline-block”, because I really want it to be hidden. And anyway this doesn’t seem to work, for me: see e.g. http://biskup.biowiki.org/blah2.html
  • “float:left” doesn’t work either
  • I can’t use a span element, because I really want this to be a div, so I can use it as a popup element
  • Since it’s a popup element and will eventually be detached/repositioned/reattached by the JavaScript code that pops it up (which will be triggered by clicking on the link right next to the div), I could technically put the div somewhere else in the document (e.g. right at the end); it then wouldn’t interrupt the flow; but since this HTML is dynamically generated, it’s very convenient to create the div right next to the link that reveals it, as in this example

By the way, I can prevent this by adding “display:inline” to the preceding tag (see example), but that is an extremely awkward workaround

Here’s the HTML for my example:

<!DOCTYPE html>
<html>
<head>
  <title>Dumb bug</title>
</head>
<body>


<p/>
<!-- the following (commented-out) line prevents the div from starting a newline; still seeking a better solution that is local to the div or adjacent anchor element -->
<!-- p style="display:inline;"/ -->
Here is some text.
Here is a
<a href="#">  link</a>.
<div style="display:none;">
  This text is inside the hidden div, and should not be shown.
  (A separate piece of code will detach/reattach/position/show this div as a popup, but it's convenient to generate it in the same place as the link.)
</div>
And here is some more text, that I want to flow on the same line after the link.

And some more.

<p/>
<p style="display:inline;"/>
Here is another paragraph.


</body>
</html>

Edited to add: the singleton p/ tags are sloppy syntax that most browsers forgive (interpreted as p … p/ enclosing the div elements), and this was hiding a basic misunderstanding on my part of how the div was inheriting layout style from its parent p.

If I change the singleton p/ tags to this, as suggested by samiz and IsisCode in replies…

<p style="display:inline">
...
<p/>

…then I get the desired behavior (the text flows).

For the same example with more context on the dynamic behavior (i.e. what happens when the link is clicked).

  • 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-02T19:12:54+00:00Added an answer on June 2, 2026 at 7:12 pm

    By the way, I can prevent this by adding “display:inline” to the preceding tag (see example), but that is an extremely awkward workaround

    This is how HTML works. <p> is a block-line element, that is, it takes up its entire row. Your hidden div isn’t causing the line break, the preceding <p> element is.

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

Sidebar

Related Questions

I know that this question have been asked several times. But I can't get
I know that this question had been asked many times, but every answer seems
This question seems to be asked freqeuently over the internet but I still can't
This question seems to have been asked a lot, but I haven't seen an
(I asked a variation of this question on comp.std.c++ but didn't get an answer.)
I've asked this question before but I didn't seem to get the right answer.
I asked this question yesterday got a pretty good answer but can't figure out
I realize that there was a similar question asked here , but this is
I already asked this question but I didn't get my answer. Btw I found
This question has problably been asked before, but it seems like I can't phrase

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.