How to wrap two spans into one line with CSS

Tags: css,line,html

Problem :

I want to wrap two spans in one line with CSS.

Here is my code:

<div style="width:60px;">
    <span id="span1" style="float:left; display:inline;"></span>
    <span id="span2" style="float:left; display:inline; "></span>

But it doesn't work.

How to do that?


I want to use the "id", either use div or span, I just want them to be in one line.

When I just use span without style, the content are not in the same line. The second line will go down.

Solution :

<div style="float:left;">
<span style="display:inline;"></span>
<span style="display:inline; "></span>

    CSS Howto..

    how to use linked animated css?

    how do i place text opposite to Anchor Tag Using CSS [closed]

    Hide and show divs with multiple common classes

    How to align text and image in xslt with css

    How to add custom code to specific
  • s in wordpress while building navigation?
  • How to dynamically change pseudo-class value in css

    Apple's Website - How Does It Autosize Itself For Mobile Devices?

    How set the same height of divs

    css how to align a graphic on page

    How to make a TableLayoutPanel like resizable div in html

    How to make a background color white on drop down

    How to show hidden div in the same line as the paragraph text?

    I would like to have the users change the CSS using an optional panel. How should I do this? [closed]

    how to improve this CSS layout which look like a table [closed]

    CSS floats - how do I keep them on one line?

    How to link after the CSS-Animation?

    How to display text on the same line?

    how to make slide animation?

    CSS triangle over a div using :before and :after - weird offset, how to fix?

    How can i make the responsive design using CSS?

    How can you do this in CSS

    How do I detect box-sizing border-box support with Modernizr

    HTML/CSS/JS - How to change and image and text on click

    PHP: How to style session output [closed]

    How can I make responsive JQuery left margin?

    Show and Hide option for DIV(needs modification)

    How to display search icon on right side through css?

    How to give a nested HTML table cell a transparent background?

    How to create straight line with same css gradient at both ends?

    How do I center my content inside the menu?