How to place different div elements in single line?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tess1243
    New Member
    • Jun 2010
    • 20

    #1

    How to place different div elements in single line?

    I want to place three different labels in single line.

    Example:
    Code:
    
    <div id="lbl1" class="Label">
    	<div class="Label-pnl10010">
    		<span class="Label-pnl10010-lbl10010">Are you sure you want to move the student(s) below from</span>
    	</div><div class="Label-pnl10020">
    		<span class="Label-pnl10020-lbl10010">SchoolName 1</span>
    
    	</div><div class="Label-pnl10030">
    		<span class="Label-pnl10030-lbl10010">to</span>
    	</div><div class="Label-pnl10040">
    		<span class="Label-pnl10040-lbl10010">SchoolName 2</span>
    	</div>
    </div>

    I need to style in such a way that the statement should look like "Are you sure you want to move the student(s) below from SchoolName 1 to SchoolName 2".

    SchoolName1 and SchoolName2 are not constant. The schoolNames keep changing.

    Is this possible?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    there are two main options: float and inline. but maybe you don’t need the divs at all.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      What generated this markup? Looks like some government issue or large corporation treating HTML like part numbers.

      Comment

      • tess1243
        New Member
        • Jun 2010
        • 20

        #4
        Originally posted by Dormilich
        there are two main options: float and inline. but maybe you don’t need the divs at all.
        Thanks Dormilich.

        Can you please elaborate your reply. I mean, can you tell me that how can I use the float and inline, and how can I do that without divs.

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          to begin with, I see no need to use the divs at all, if you want the text in one line. no divs => all in one line without much ado.

          Comment

          • tess1243
            New Member
            • Jun 2010
            • 20

            #6
            Originally posted by Dormilich
            to begin with, I see no need to use the divs at all, if you want the text in one line. no divs => all in one line without much ado.
            Thank you Dormilich.

            Float and inline worked. :)

            Comment

            Working...