Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I format this div without the text inside breaking a line? [duplicate]

I have this html code

<h2>
  <div style="display:flex">
  <div>
    Section III :
  </div>
  <div>
    Very long parangrapgggggggggggggggggggggggggggggggggggggggggggggggggggggggg
  </div>
  </div>
</h2>

The space inside the first div makes a new line, Can any body suggest how to attain this format ? I dont to have anything below the Section III, I dont want to use tho and I dont want to adjust width padding etc, is there a way to achieve this ?

like image 238
Leroy Avatar asked Jan 26 '23 12:01

Leroy


1 Answers

Looks like the text breaks into multiple lines, which makes it look odd. I added the white-space: nowrap styling. You may also want to add some spacing between the two divs.

<h2>
  <div style="display:flex; white-space: nowrap;">
    <div>
      Section III :
    </div>
    <div>
      Very long parangrapgggggggggggggggggggggggggggggggggggggggggggggggggggggggg
    </div>
  </div>
</h2>
like image 157
Celsiuss Avatar answered Jan 28 '23 10:01

Celsiuss