Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I Join two paragraphs to display inline together without jusitified text moving around?
    text
    copied!<p>I'm trying to take two paragraphs and join them together to display inline. I know I can use a span tag instead of p tags but my problem is this. I want the text to be justified in both paragraphs. I want to set the second paragraph to display:none (hidden) to start off. Using jQuery I will toggle the display:none to show the hidden text in the second paragraph. I don't want the text on the last line of the first paragraph to start moving around when the second paragraph is revealed. This is where I am stuck. I can join the paragraphs together but I'm getting movement on the last line of text because I am adding new text to that last line in the first paragraph. It's re-justifying the last line of text. It doesn't look good when this happens.</p> <p>Remember, the text in the second paragraph will continue at the end of the first paragraph without a line break.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() { $('span[id=span2]').addClass('hidepar'); $('span[id=span1]').click(function() { $('span[id=span2]').fadeToggle(1000); }); });</code></pre> <pre class="snippet-code-css lang-css prettyprint-override"><code>.hidepar { display: none; } #div1 { text-align: justify; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="div1"&gt; &lt;span id="span1" style="display:inline"&gt;Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.&lt;/span&gt; &lt;span id="span2"&gt;Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.&lt;/span&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload